Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4840

ServletWebResponse/RequestCycle: NPE after upgrading from 6.0.0 to 6.2.0

    XMLWordPrintableJSON

    Details

      Description

      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?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pparson Peter Parson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: