Peter Parson created WICKET-4840:
------------------------------------

             Summary: 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


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

Reply via email to