3

I have some variables in my action class.

Now I want to redirect to another action by setting those variable values as request parameters. How I can do this?

I'm trying to do it like this:

<result type="redirect">myProfileShow?param1=${value}&param2={value2}</result>

It is not working.

1
  • 6
    Define "not working"; if myProfileShow is an action you should be using a redirectAction result. If there are publicly-available getValue() and getValue2() methods, I don't see anything immediately obvious. Commented Jan 15, 2013 at 23:15

1 Answer 1

2
<result type="redirectAction">
    <param name="actionName">myProfileShow</action>
    <param name="param1">${value}</param>
    <param name="param2">${value2}</param>
</result>

where value and value2 should be declared in the Action class. You can also set hard-coded values for value & value2.

    <param name="param1">10</param>   <!--  param1 will be 10 --!>
    <param name="param2">15</param>   <!--  param2 will be 15 --!>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.