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

Parameters which are added via ServletDispatcherResult aren't availabe in #parameters

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.10
    • Fix Version/s: 2.5.12
    • Component/s: Core Results, Value Stack
    • Labels:
      None

      Description

      before Version 2.5.5 the parameters were accessible via #parameters (example: #parameters.foo)
      now I won't get the parameters which are defined via location, only the request parameters

      I have an action like this

      MyTest.java
      @Action(value = "execute", results = @Result(name = SUCCESS, type = DISPATCHER, location = "index.jsp?foo=bar"))
      public String execute() {
          return super.execute();
      }
      

      and that's the TestCase

      MyTest.java
              @Test
              public void testParameters() throws UnsupportedEncodingException, ServletException {
                      request.addParameter("test", "me");
                      executeAction("/test/dispatcher/execute.html");
                      assertEquals("me", findValueAfterExecute("#parameters.test[0]"));
                      assertEquals("bar", findValueAfterExecute("#parameters.foo[0]"));
              }
      

      my current workaround:

      #attr['com.opensymphony.xwork2.ActionContext.parameters'].foo
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aleksandr-m Aleksandr Mashchenko
                Reporter:
                Michael Hintenaus Michael Hintenaus
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: