Menu

#24 verifyActionForward flawed

RequestProcessor
open
nobody
None
5
2004-06-10
2003-04-08
No

In my struts.config I might have the following "success"
forward defined for action "/modifyProjectTask":
<forward name="success"
path="/viewProjectTaskList.do" redirect="true"/>

In my action class, I am appending a 'projectId' attribute
to the URL, because I need to view the task list for a
particular project. Having redirect="true" means it has to
be on the URL because the request will be thrown away.
We use redirect="true" so that in the end the URL
shows what is actually happening
(viewProjectTaskList.do) as opposed to what initiated
the result (modifyProjectTask.do)

When I verifyActionForward("success") I get an
assertionFailedException because the returned url
is "/viewProjectTaskList.do?projectId=12345" but it is
simply expecting "/viewProjectTaskList.do".

verifyActionForward needs to be able to ignore appended
parameters when determining whether the forward was
acturlly used or not.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    There is also a problem with absolute urls. If my forward is
    http://www.yahoo.com, verifyActionForward will prepend a /
    to it and it will fail the comparison.

     
  • 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.