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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.10
    • 2.5.12
    • Core Results, Value Stack
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: