Anyone seen the same behaviour? 

-----Original Message-----
From: Al Sutton [mailto:[EMAIL PROTECTED] 
Sent: 30 May 2007 13:23
To: 'Struts Users Mailing List'
Subject: Wierd behaviour with redirect, result, and store interceptor

I have the following;
 
Action A --- forwards to ---> A.jsp --- submits to ---> Action B ---
redirects to ---> Action A
 
The B to A redirect uses the store interceptor to pass action messages and
action errors to Action A.
 
When I add an ActionError in Action B (using addActionError from
ActionSupport) I get an struts error back saying it can't find the input
result for Action A.
 
I've tried using only a SUCCESS result for Action B to redirect to Action A,
and I've tried using an INPUT result to redirect from Action B to Action A
when an ActionError is added, in both cases it still reports an error about
an input result for Action A.
 
If I do add an input result to Action A struts picks it up and uses it, but
the problem is that I want to send the user back to action A if an error
occurs.
 
I couldn't find anything like this in Jira, is this a know problem and is
there a workaround?
 
Al.
 
P.S. For the interested, here are the specifics;
 
Action A gets the current comments relevant to a topic, A.jsp allows a user
to add a comment, Action B adds the comment to the database and then sends
the user back to action A in order to redisplay all the comments.
 
I have a custom interceptor which handles the hibernate session creation,
it's added into the interceptor stack by defining myInterceptorStack which
has the hibernate interceptor plus the default stack.
 
struts.xml action definitions;
<action name="ActionA" class="com.alsutton.demo.ActionA" >  <interceptor-ref
name="store">
  <param name="operationMode">RETRIEVE</param>
 </interceptor-ref>
 <interceptor-ref name="myInterceptorStack" />
<result>/myapp/showcomments.jsp</result>
</action>

<action name="ActionB" class="com.alsutton.ActionB" > <interceptor-ref
name="store">
  <param name="operationMode">STORE</param>
 </interceptor-ref>
 <interceptor-ref name="myInterceptorStack" />  <result
type="redirect">/myapp/ActionA.action</result>
 <result name="input" type="redirect">/myapp/ActionA.action</result>
</action>

 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to