Hi,
Take a look at Prepare Interceptor [1] and Preparable interface [2]
[1] http://struts.apache.org/2.x/docs/prepare-interceptor.html
[2]
http://struts.apache.org/2.0.11.2/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html
Regards
--
Lukasz
http://www.lenart.org.pl/
Hi.
Thanks for your answer. But as I said in my original post, the prepare
interceptor would prepare the action regardless of the validation result. If
the validation succeeds, I don't want the data for the input page to be
prepared, as the flow will go to the submit method which will redirect
You can use perpareXXX method per action method as mentioned in docs:
Applies only when action implements Preparable
1. if the action class have prepare{MethodName}(), it will be invoked
2. else if the action class have prepareDo(MethodName()}(), it will
be invoked
3. no matter if 1] or
I know that. But this does not solve the problem I described. prepareXxx will
be invoked if I the action method is xxx. I validation fails, it'll work: the
input page will have the prepared data ready in the action instance. If
validation succeeds, however, the prepareXxx method will have
How did you configure your input method? What is the name of this
method? I still don't understand why you can use Prepare interceptor,
just implement prepareDoInput() method and that method will be called
just before input() call.
If input result redirect to some other action, configure and
I don't have any input method. I have a displayForm method, and a submitForm
method.
The displayForm method returns an input *result*, which is a default result
pointing to a JSP. This JSP has to display some data coming from the database.
I'd like this same JSP to be displayed when the input
--- On Mon, 9/8/08, [EMAIL PROTECTED] wrote:
I don't have any input method. I have a displayForm
method, and a submitForm method.
The displayForm method returns an input *result*, which is
a default result pointing to a JSP. This JSP has to display
some data coming from the database. I'd
party other than intended recipient. Sender does
not necessarily endorse content contained within this transmission.
Date: Mon, 8 Sep 2008 23:02:49 +0200
From: [EMAIL PROTECTED]
To: user@struts.apache.org
Subject: Re: prepare action for input after validation errors
I don't have any input
--- On Mon, 9/8/08, Martin Gainty wrote:
you can return the result you desire from the Action which
implements parameterNameAware interceptor
action name=someAction class=com.examples.SomeAction
interceptor-ref name=params/
result name=successgood_result.ftl/result
/action
Hello.
I'm reading the documentation for Struts 2 (after lots of work on Struts
1 and Beehive), and I wonder if an interceptor exists in order to
prepare the action after the validation fails, and before going back to
the input page. Imagine the following action class :
public class
10 matches
Mail list logo