Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3107

NPE whlie use ServletActionRedirectResult as Result type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.8
    • 2.1.8
    • None
    • None

    Description

      This bug was appeared after WW-3046
      Example
      public ServletActionRedirectResult generate()
      throws Exception
      {
      ServletActionRedirectResult redirect = new ServletActionRedirectResult("/namespace", "someaction", "method");
      redirect.addParameter("param", "value");
      return redirect;
      }
      After execute this method we have caught NPE in codeplace:
      -----ServletActionRedirectResult.class
      (169 line)
      ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(invocation.getResultCode());
      Map resultConfigParams = resultConfig.getParams();
      -----ServletActionRedirectResult
      invocation.getResultCode() == null and as result resultConfig == null
      Upd: stacktrace
      java.lang.NullPointerException
      at org.apache.struts2.dispatcher.ServletRedirectResult.doExecute(ServletRedirectResult.java:170)
      at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
      at org.apache.struts2.dispatcher.ServletActionRedirectResult.execute(ServletActionRedirectResult.java:176)
      at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
      at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:251)
      at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      -----cut-----

      Attachments

        Activity

          People

            wesw@wantii.com Wes Wannemacher
            avasenin Andrey Vasenin
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: