click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Rybin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CLK-625) createPage makes htm-to-class duplicates
Date Sat, 19 Jun 2010 11:43:22 GMT

    [ https://issues.apache.org/jira/browse/CLK-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880471#action_12880471
] 

Andrey Rybin commented on CLK-625:
----------------------------------

1)  click.xml MODE must be development, debug or trace.

In production/profile mode all works fine (throwing exception):
java.lang.IllegalArgumentException: No Page class configured for path: ControlListenerType1Page.htm


2) I use Tomcat 6.0.20, so bug is still here.


3) my debug:
org.apache.click.service.XmlConfigService
    public Class<? extends Page> getPageClass(String path) {
...
URL resource = servletContext.getResource(path);//ControlListenerType1Page.htm
returns   jndi:/localhost/clickDemo/ControlListenerType1Page.htm

but this resource value is just checked for != null.


I think Click can: 
- require leading / in createPage == same behavior in all modes

- convert those relative paths to absolute paths (using path from current Context.Request).
 May fall in production...




> createPage makes htm-to-class duplicates
> ----------------------------------------
>
>                 Key: CLK-625
>                 URL: https://issues.apache.org/jira/browse/CLK-625
>             Project: Click
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: Andrey Rybin
>
> We have 
> - ControlListenerType1Page.htm - in web root
> and
> ControlListenerType1Page.java 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.


Mime
View raw message