HybridUrlEncoding Strategy throws uncaught NumberFormatException if Integer 
value space is violated
---------------------------------------------------------------------------------------------------

                 Key: WICKET-3490
                 URL: https://issues.apache.org/jira/browse/WICKET-3490
             Project: Wicket
          Issue Type: Bug
          Components: wicket-core
    Affects Versions: 1.4.15
         Environment: Wicket Pages using HybridUrlCodingStrategy, we are using 
Jetty 6
            Reporter: Georg Hartner
            Priority: Minor


We are using HybridUrlCodingStrategy for some of our pages. Our tester tried 
entering a URL like 
https://{serverHost}:{serverPort}/{applicationContextPath}/{pageMountPath}.999999999999999999999999999999999999999999999999999999999999999999999999999
 

99999999... => this PageId does not exist, which is checked later in the 
execution path. The problem is that in 
org.apache.wicket.request.target.coding.HybridUrlCodingStrategy$PageInfo.parsePageInfo(HybridUrlCodingStrategy.java:873)
 Integer.valueOf(999999999999...) is called, which correctly causes a 
NumberFormatException being thrown. This Exception should be handled like an 
Unknown PageId from our point of view.

Error Page/ Stack Trace:
HTTP ERROR 500

Problem accessing 
/login.999999999999999999999999999999999999999999999999999999999999999999999999999.
 Reason:

    For input string: 
"999999999999999999999999999999999999999999999999999999999999999999999999999"

Caused by:

java.lang.NumberFormatException: For input string: 
"999999999999999999999999999999999999999999999999999999999999999999999999999"
        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Integer.parseInt(Integer.java:461)
        at java.lang.Integer.valueOf(Integer.java:554)
        at 
org.apache.wicket.request.target.coding.HybridUrlCodingStrategy$PageInfo.parsePageInfo(HybridUrlCodingStrategy.java:873)
        at 
org.apache.wicket.request.target.coding.HybridUrlCodingStrategy.matches(HybridUrlCodingStrategy.java:644)
        at 
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy$MountsMap.strategyForPath(WebRequestCodingStrategy.java:1145)
        at 
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.urlCodingStrategyForPath(WebRequestCodingStrategy.java:444)
        at 
org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy.urlCodingStrategyForPath(CryptedUrlWebRequestCodingStrategy.java:174)
        at 
org.apache.wicket.protocol.http.WicketFilter.getLastModified(WicketFilter.java:1147)
        at 
org.apache.wicket.protocol.http.WicketServlet.getLastModified(WicketServlet.java:284)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:703)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)

Please don't hesitate contacting me if you need more information or send me 
advice if you want me to contribute a fix for this issue.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to