You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by tomasz bandura <to...@gmail.com> on 2010/06/23 16:39:18 UTC

Problem with ActionLink in table on GAE

Hello,


I noticed a strange behaviour with usage ActionLink in table :

The standard example works, each column has generated properly link to the
acition, eg
for edit row number 1 : <app>*/edit-element.htm*?id=1

The problem after deploying an application on Google App Engine,
the same link is rendered incorrectly: <app>*/null*?id=1


You can see it on a live jpa example on
http://click-jpa.appspot.com/view-customers.htm page

for example the first row to view action has link:

http://click-jpa.appspot.com*/null*
;jsessionid=AnreZWRkk9K5YGlTekob3g?id=1585013&referrer=%2Fview-customers.htm

I think it is probably the same error like in my application


Best regards


Tomasz

Re: Problem with ActionLink in table on GAE

Posted by "Adrian A." <a....@gmail.com>.
> I've lodged an issue on GAE[1] to fix their getResourcePaths implementation.
>
> Hopefully this gets accepted, otherwise we'll have to workaround using a convention based solution.
> [1]: http://code.google.com/p/googleappengine/issues/detail?id=3417
Maybe we could ask the users that need GAE/J to vote/comment for this issue.

Adrian.


Re: Problem with ActionLink in table on GAE

Posted by Bob Schellink <sa...@gmail.com>.
I've lodged an issue on GAE[1] to fix their getResourcePaths implementation.

Hopefully this gets accepted, otherwise we'll have to workaround using a convention based solution.

Kind regards

Bob

[1]: http://code.google.com/p/googleappengine/issues/detail?id=3417

Re: Problem with ActionLink in table on GAE

Posted by Bob Schellink <sa...@gmail.com>.
On 1/07/2010 23:18, tomasz bandura wrote:
> Hi Bob,
> 
> I also noticed that links work after at least invocation ( initialization)
> So if i put a link to the table element manually it will work.
> 
> It looks like the page and link are registered after initialization
> (onInit() ??)


Don't think so. At startup time Click maps all pages to templates. When the Context is used to
lookup the page by path (and the page path cannot be found) Click attempts to lookup the page again.
Note this is strictly development behavior. Once the page mapping has been established, it will be
cached, and table links will start working. So the loading depends on *when* the Context is used to
retrieve the page.

You'll also note different behavior from getContext().getPagePath(PAge.class) and
getContext().getPageClass("home.htm").  Looking up by getPagePath won't perform the "lazy load",
while getPageClass does.

Regardless my hope is that GAE fixes the issue with getResourcePaths("/"). Barring a fix we can use
some convention such as placing templates under 'page' or 'pages'.

I've updated the JPA-example[1] to place templates under 'page' folder and it seems to work fairly
well. Note this change hasn't been checked in so it is not available yet.

Kind regards

Bob

[1]: http://click-jpa.appspot.com/page/home.htm

Re: Problem with ActionLink in table on GAE

Posted by tomasz bandura <to...@gmail.com>.
Hi Bob,

I also noticed that links work after at least invocation ( initialization)
So if i put a link to the table element manually it will work.

It looks like the page and link are registered after initialization
(onInit() ??)


regards

Tomasz

2010/6/24 Bob Schellink <sa...@gmail.com>

> On 25/06/2010 00:34, Bob Schellink wrote:
> > Btw, a workaround exists which is to not use automapping. Instead you
> could manually map out the
> > urls to page classnames.
>
>
> Seems there might be a fix after all. GAE doesn't return anything when
> querying the root web
> folder("/"), but it does when querying a given folder such as ("/page"). So
> we could have a
> convention that Click templates must be defined under the 'page' folder.
> With this caveat GAE should
> work with automapping as well.
>
> Bob
>

Re: Problem with ActionLink in table on GAE

Posted by Bob Schellink <sa...@gmail.com>.
On 25/06/2010 00:34, Bob Schellink wrote:
> Btw, a workaround exists which is to not use automapping. Instead you could manually map out the
> urls to page classnames.


Seems there might be a fix after all. GAE doesn't return anything when querying the root web
folder("/"), but it does when querying a given folder such as ("/page"). So we could have a
convention that Click templates must be defined under the 'page' folder. With this caveat GAE should
work with automapping as well.

Bob

Re: Problem with ActionLink in table on GAE

Posted by Bob Schellink <sa...@gmail.com>.
Btw, a workaround exists which is to not use automapping. Instead you could manually map out the
urls to page classnames.

Kind regards

Bob

On 24/06/2010 09:29, Bob Schellink wrote:
> Hi Tomasz,
> 
> When I integrated Click with GAE initially, GAE supported the method Servlet API
> "ServletContext.getResourcePaths" which Click uses to find the templates. Since then GAE have
> dropped support for this method which breaks Click. I'll try and work on fix but it is not trivial
> unfortunately.
> 
> Kind regards
> 
> Bob
> 
> On 24/06/2010 00:39, tomasz bandura wrote:
>> Hello,
>>
>>
>> I noticed a strange behaviour with usage ActionLink in table :
>>
>> The standard example works, each column has generated properly link to
>> the acition, eg
>> for edit row number 1 : <app>*/edit-element.htm*?id=1
>>
>> The problem after deploying an application on Google App Engine,
>> the same link is rendered incorrectly: <app>*/null*?id=1
>>
>>
>> You can see it on a live jpa example on
>> http://click-jpa.appspot.com/view-customers.htm page
>>
>> for example the first row to view action has link:
>>
>> http://click-jpa.appspot.com*/null*;jsessionid=AnreZWRkk9K5YGlTekob3g?id=1585013&referrer=%2Fview-customers.htm
>>
>> I think it is probably the same error like in my application
>>
>>
>> Best regards
>>
>>
>> Tomasz
> 
> 


Re: Problem with ActionLink in table on GAE

Posted by Bob Schellink <sa...@gmail.com>.
Hi Tomasz,

When I integrated Click with GAE initially, GAE supported the method Servlet API
"ServletContext.getResourcePaths" which Click uses to find the templates. Since then GAE have
dropped support for this method which breaks Click. I'll try and work on fix but it is not trivial
unfortunately.

Kind regards

Bob

On 24/06/2010 00:39, tomasz bandura wrote:
> Hello,
> 
> 
> I noticed a strange behaviour with usage ActionLink in table :
> 
> The standard example works, each column has generated properly link to
> the acition, eg
> for edit row number 1 : <app>*/edit-element.htm*?id=1
> 
> The problem after deploying an application on Google App Engine,
> the same link is rendered incorrectly: <app>*/null*?id=1
> 
> 
> You can see it on a live jpa example on
> http://click-jpa.appspot.com/view-customers.htm page
> 
> for example the first row to view action has link:
> 
> http://click-jpa.appspot.com*/null*;jsessionid=AnreZWRkk9K5YGlTekob3g?id=1585013&referrer=%2Fview-customers.htm
> 
> I think it is probably the same error like in my application
> 
> 
> Best regards
> 
> 
> Tomasz