You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Timothy Orme <to...@genome.med.harvard.edu> on 2009/10/13 17:37:42 UTC

Passing List with Redirect

Hi All

    I'm wondering if theres a way to pass a list of values as a 
parameter in a redirectAction. For instance:

    <action name="WorkAction" class="test.WorkAction">
            <result name="success" type="redirectAction">
                <param name="actionName">ViewAction</param>
                <param name="myList">${myList}</param>
                <param name="myProperty">${myProperty}</param>
            </result>
        </action>


    In this case, myList is an array list that is populated in 
WorkAction. ViewAction then has a setter for an Array List of the same 
name. myProperty is just a string.

    This doesn't work as it stands, I get a string representation of the 
array instead of the array passed. So in the ViewAction instead of a 2 
item array, I get a single item array with a string like:

    "[TEST A, TEST B]"

    While this is certainly parsable, I was wondering if theres a way to 
handle this with something already built into struts. I'm also aware 
that it's possible to solve this using the session, but I was curious if 
theres a way to avoid doing it that way.

Thanks,
Tim O


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org