struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <...@Germuska.com>
Subject Re: How to change "input" property of "Action" tag in Custom Validator Class
Date Wed, 16 Mar 2005 12:17:56 GMT
At 11:57 AM +0000 3/16/05, Bing Qiao wrote:
>Hello,
>
>I build a custom Validator class for a DynaActionForm.
>The action tag looks like:
><action path="/submitpay" type="SubmitPayFormAction"
>parameter="action" name="paymentForm" scope="request"
>input="/paymentForm.jsp">
>When the validation fails the request will be directed to paymentForm.jsp.
>
>I wonder if it's possible to direct the request to different pages in
>my custom validator class. This might be done by setting the input to
>an intermediate action or jsp, which is however not preferable in my
>case.
>
>In a word, is there a way to tell struts not to use the path defined
>in "input" but another one in Validator class?

One thing you cannot do is change the value of "input" on an instance 
of ActionMapping which was created by Struts from a struts-config.xml 
-- those objects are shared and their configurations are frozen after 
initialization.

To do what you describe, you would have to make changes to the 
RequestProcessor class.  This is certainly possible, but for your use 
case, you may just find it simpler to do the validation yourself in 
an action class.  Just set "validate='false'" in your <action> 
element and then write your action class knowing that the validation 
needs to happen.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Mime
View raw message