click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Md. Jahid Shohel (JIRA)" <>
Subject [jira] Commented: (CLK-625) createPage makes htm-to-class duplicates
Date Sat, 19 Jun 2010 22:49:24 GMT


Md. Jahid Shohel commented on CLK-625:

Ok, I was investigating the issue. First of all the problem does not happen on jetty, so I
was not getting any error. 

Now for "servletContext.getResource(path)" Jetty returns null, and Tomcat returns non null
value (they add a / in front if the path does not start with /, and try to find the resource).

The Servlet specification says - 

"The path must begin with a / and is interpreted as relative to the current context root"

Which means, this is a bug on Tomcat. Tomcat should not add a / in front, but should return

We can solve the issue but checking if the path starts with "/", and if not then we add a
"/" before processing. But I do not think that we should do that. But instead we should follow
the Servlet specification. In our code we have clear path defined for null as return value.
Which is throwing IllegalArgumentException for null values.

> createPage makes htm-to-class duplicates
> ----------------------------------------
>                 Key: CLK-625
>                 URL:
>             Project: Click
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: Andrey Rybin
> We have 
> - ControlListenerType1Page.htm - in web root
> and
> with:
>   @Bindable protected ActionLink bugMaker = new ActionLink(this, "makeBug");
>   public boolean makeBug () {
>     Page p = getContext().createPage("ControlListenerType1Page.htm");// without leading
>     if (!(p instanceof ControlListenerType1Page)) { throw new Error("very bad"); }
>     //successfully!  BUT now htm-to-class map contains two mappings for ControlListenerType1Page.class:

>     //  ControlListenerType1Page.htm->ControlListenerType1Page.class and 
>     //  /ControlListenerType1Page.htm->ControlListenerType1Page.class 
>     p = getContext().createPage(ControlListenerType1Page.class);
>     //^^^throws java.lang.IllegalArgumentException with message:
>     //Page class resolves to multiple paths: net.sf.apr.cui.ControlListenerType1Page
-> [/ControlListenerType1Page.htm, ControlListenerType1Page.htm]
>     setForward(p);    return true;
>   }

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message