Menu

#53 Not preserving struts forward attribute values

RequestProcessor
open
nobody
None
5
2004-06-10
2004-03-24
Anonymous
No

Setup:
Have a forward like this:
<action path="/Test" forward="/Test.do?
testkey1=value1&amp;testkey2=value2"
roles="anyone" />

Code snippet:

setRequestPathInfo("/Test.do");
actionPerform();
System.out.println(this.getActualForward());
setRequestPathInfo(getActualForward());
actionPerform();
HttpServletRequestSimulator req =
getMockRequest();
System.out.println(req.getAttribute("testkey1"));

In the line, setRequestPathInfo(getActualForward()) the
attributes on the forward line get truncated.
Common.stripActionForward is where the stripping is
happening.

A portion of the output from running the above code is:

[03-24 09:28]DEBUG <struts.MockStrutsTestCase> -
Exiting getActualForward()
[03-24 09:28]DEBUG <struts.MockStrutsTestCase> -
Entering setRequestPathInfo() : pathInfo = /Test.do?
testkey1=value1&testkey2=value2
[03-24 09:28]DEBUG <struts.MockStrutsTestCase> -
Entering setRequestPathInfo() : moduleName = ,
pathInfo = /Test.do?testkey1=value1&testkey2=value2
[03-24 09:28]DEBUG <struts.Common> - Entering
stripActionPath() : path = /Test.do?
testkey1=value1&testkey2=value2
[03-24 09:28]DEBUG <struts.Common> - Exiting
stripActionPath() - returning path = /Test
[03-24 09:28]DEBUG <struts.MockStrutsTestCase> -
setRequestPathInfo() : setting request attribute - name
= javax.servlet.include.servlet_path, value =
[03-24 09:28]DEBUG <struts.MockStrutsTestCase> -
Exiting setRequestPathInfo()

Discussion

  • Deryl Seale

    Deryl Seale - 2004-06-10
    • milestone: --> RequestProcessor
     
  • Deryl Seale

    Deryl Seale - 2004-06-10

    Logged In: YES
    user_id=366284

    Fixing this bug is very difficult with the current Struts
    (1.1) RequestProcessor architecture. The Struts team is
    working on making this more flexible, which will allow me to
    re-architect StrutsTestCase to be more robust.

    There is no time frame for this work.

     

Log in to post a comment.