You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Parson (JIRA)" <ji...@apache.org> on 2012/10/29 10:33:12 UTC

[jira] [Commented] (WICKET-4840) ServletWebResponse/RequestCycle: NPE after upgrading from 6.0.0 to 6.2.0

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

Peter Parson commented on WICKET-4840:
--------------------------------------

Thanks for your reply - actually, I copied this implementation from the Wicket Wiki:
https://cwiki.apache.org/WICKET/seo-search-engine-optimization.html#SEO-SearchEngineOptimization-Wicket1.5

Can you tell me what the overriding implementation of encodeRedirectURL should look like instead?

                
> ServletWebResponse/RequestCycle: NPE after upgrading from 6.0.0 to 6.2.0
> ------------------------------------------------------------------------
>
>                 Key: WICKET-4840
>                 URL: https://issues.apache.org/jira/browse/WICKET-4840
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.2.0
>            Reporter: Peter Parson
>            Priority: Minor
>              Labels: nullpointerexception, requestcylce
>
> My WebAplication uses the following code to get rid of the jsessionid parameter for certain user agents, which worked fine with Wicket 6.0.0 but results in a NullPointerException now.
> @Override
>     protected WebResponse newWebResponse(final WebRequest webRequest, final HttpServletResponse httpServletResponse){
>         return new ServletWebResponse((ServletWebRequest)webRequest, httpServletResponse) {
>             @Override
>             public String encodeURL(CharSequence url) {
>                 final String agent = webRequest.getHeader("User-Agent");
>                 return isAgent(agent) ? url.toString() : super.encodeURL(url);
>             }
>             @Override
>             public String encodeRedirectURL(CharSequence url) {
>                 return encodeURL(url);
>             }
>         };
>     }
> It is exactly the same issue as discussed here (about version 6.1.1):
> http://comments.gmane.org/gmane.comp.java.wicket.user/106013
> ServletWebResponse:181 - RequestCycle.get() returns null.
> Workaround is to check for null before calling super.encodeURL(url), but I assume this is a bug?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira