Hello list,
thanks for the suggestions! I tried to disable the TT-Cache and also
to reset the CGI parameters after each call, but both does not help.
It seems like CGI.pm is not compatible with the Catalyst build in web-
server.
As a solution, I'm now using the Catalyst::Request object from within
TT to access GET parameters, which works fine.
However, it's still strange that in the below example the variable [%
CGI.params.x %] is forever staying at the initial value but [%
c.req.params.x %] is changing with every request. Sound like a bug to
me... Maybe it would be helpful for others to pur this one into a FAQ
somewhere? :)
[% PROCESS header %]
[% USE CGI %]
Content of x: [% CGI.params.x %]<p>
Content of x: [% c.req.params.x %]<p>
[% PROCESS footer %]
Thanks, Marc :)
On 07.02.2009, at 13:25, Kelly Thompson wrote:
> My guess would be the server is caching it. There is a configuration
> option: CACHING_SIZE, when set to "0" it disables caching altogether.
> If you don't want to do that site wide, just include it in you
> constructor for "that" template.
>
> my $tt = Template->new({
> CACHING_SIZE => 0 });
>
> etc...
>
> Here's a link:
> http://www.template-toolkit.org/docs/manual/Config.html#section_Caching_and_Compiling_Options
>
>
> On Sat, Feb 7, 2009 at 5:07 AM, Marc Sebastian Pelzer <[email protected]
> > wrote:
> Hello,
>
> I played around with TT2 and the CGI Plugin a little bit and found a
> strange behavior:
>
> - I just created a brand new Catalyst application with standard
> components
>
> _ I created a TT template, which looks like this:
>
> [% PROCESS header %]
>
> [% USE CGI %]
>
> [% myTest = CGI.params.test %]
>
> You sent the string '[% myTest %]'
>
> [% PROCESS footer %]
>
> and modified the Root.pm controller to look like this:
>
> sub default : Path : Args {
> my ( $self, $c, @path ) = @_;
>
> my $path = join('/', @path);
>
> if (-e "root/" . $path . '.tt') {
>
> $c->stash->{template} = $path . '.tt';
> }
> }
>
> (I need this kind of URL2template matching for different reasons) and
> then started the build in web-server (./script/my_app_server.pl -d -p
> 8080).
>
> When I call the template for the first time with some 'test' GET
> parameter, it will be shown correctly in the output. When I then
> modify this GET parameter to another value and do the request, it does
> not change and still is showing me the first value I set. Even when I
> load the URL in a different browser, I still see the first defined
> value for 'test' - so it's not a browser caching issue. When I run the
> test-script "./script/my_app_test.pl" it works fine - the GET
> parameter changes, because it's not using the Catalyst server which
> runs all the time.
>
> Does anyone have an idea what could be wrong? Maybe the CGI module
> does not get reseted between requests?
>
> Many thanks in advance :) Marc
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://mail.template-toolkit.org/mailman/listinfo/templates
>
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates