Vita Rara: A Life Uncommon

Conversation Scope doesn't work after a redirect

Hi,

I want to implement your conversation interceptor, but have a little problem while using a redirect-action as result type (want to implement the POST-REDIRECT-GET Pattern):

I downloaded your tutorial and changed the struts.xml like this:

struts.xml

[action name="conversation" class="tutorial.ConversationAction"]
[interceptor-ref name="params" /]
[interceptor-ref name="conversation-scope" /]
[interceptor-ref name="defaultStack" /]
[result name="input" type="redirect-action"]/conversationRedirect[/result]
[result name="success"]/ConversationSuccess.jsp[/result]
[/action]

[action name="conversationRedirect" class="tutorial.ConversationAction" method="input"]
[interceptor-ref name="params" /]
[interceptor-ref name="conversation-scope" /]
[interceptor-ref name="defaultStack" /]
[result name="input"]/ConversationInput.jsp[/result]
[/action]

So I did a redirect instead of showing the view. The input method of the conversationRedirect action just returns "input". My problem is, that the page count of the model is not increased. To at the result page the count is 0 instead of 1.

Maybe you can help me with this problem.

Thanks

Brian
duckmailer@googlemail.com

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
  • Allowed HTML tags: <a> <img> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <h1> <h2> <h3>
  • Lines and paragraphs break automatically.
More information about formatting options