You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "vineet semwal (JIRA)" <ji...@apache.org> on 2010/01/19 09:30:54 UTC

[jira] Commented: (WICKET-2685) MixedParamsUrlCodingStrategy ,classcastexception from Long to String

    [ https://issues.apache.org/jira/browse/WICKET-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802138#action_12802138 ] 

vineet semwal commented on WICKET-2685:
---------------------------------------

i see the same problem in Mixedparamhybridurlcodingstrategy.
this time i am getting same exception at line number 129 .
i have checked that in 1.4.5 and the snapshot,

String value = param instanceof String[] ? ((String[])param)[0] :
(String)param;//line number 129
following changed i did in custommixedhybrid*strategy,
String value = param instanceof String[] ? ((String[])param)[0] :
String.valueOf(param);

everything appears to be working..





-- 
regards,
Vineet Semwal


> MixedParamsUrlCodingStrategy ,classcastexception from Long to String
> --------------------------------------------------------------------
>
>                 Key: WICKET-2685
>                 URL: https://issues.apache.org/jira/browse/WICKET-2685
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>         Environment: wicket 1.4.5,jetty 6.1.22
>            Reporter: vineet semwal
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.6
>
>
> i see classcastexception can't cast from Long to String at this line in a page(the url does not have page parameters)  at line number 138 in mixedparameterurlcodingstrategy,
> String value = param instanceof String[] ? ((String[])param)[0] : (String)param;//line number 138
>  cast in else can be clearly avoided,
> String value = param instanceof String[] ? ((String[])param)[0] : param.toString();// ie. cast changed to tostring()
> i tested that on my custommixed*strategy in which above mentioned is the only change,
> everything appears to be working,
> original exception in mixedparamurlcodingstrategy i got is as following :-
> java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
> at org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.appendParameters(MixedParamUrlCodingStrategy.java:138)
> at org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.encode(BookmarkablePageRequestTargetUrlCodingStrategy.java:149)
> at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.pathForTarget(WebRequestCodingStrategy.java:491)
> at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.encode(WebRequestCodingStrategy.java:250)
> at org.apache.wicket.RequestCycle.encodeUrlFor(RequestCycle.java:811)
> at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:999)
> at org.apache.wicket.Component.urlFor(Component.java:3316)
> at org.apache.wicket.markup.html.link.BookmarkablePageLink.getURL(BookmarkablePageLink.java:276)
> at org.apache.wicket.markup.html.link.Link.onComponentTag(Link.java:408)
> at org.apache.wicket.Component.renderComponent(Component.java:2590)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
> at org.apache.wicket.Component.renderComponent(Component.java:2619)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:122)
> at org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:103)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
> at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:675)
> at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:114)
> at org.apache.wicket.Component.renderComponent(Component.java:2619)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
> at org.apache.wicket.Component.renderComponent(Component.java:2619)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
> at org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66)
> at org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
> at org.apache.wicket.Component.renderComponent(Component.java:2619)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
> at org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:73)
> at org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
> at org.apache.wicket.Component.renderComponent(Component.java:2619)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
> at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528)
> at org.apache.wicket.Page.onRender(Page.java:1545)
> at org.apache.wicket.Component.render(Component.java:2450)
> at org.apache.wicket.Page.renderPage(Page.java:914)
> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
> at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
> at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
> at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
> at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:324)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
> at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:538)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>  				 

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