struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Noel <ericn...@mylife.ph>
Subject Re: Mixed Struts Validator Framework and ValidationForm
Date Tue, 04 May 2004 00:27:34 GMT
On 5/3/2004 10:29 PM, salgado.pc@04web.com wrote:

>   Yes.
> 
>   Extend the DynaValidator
> 
>   override the validate method
> 
>   validate(...) {
> 
>     ActionErrors errors = super.validate(...);
> 
>     // do your stuff
>     if (...) {
>         errors.add(...);
>     }
> 
> 
>     return errors;
>   }
> 
> Pedro Salgado
> 
> 
> On 04/05/03 9:40, "Eric Noel" <ericnoel@mylife.ph> wrote:
> 
> 
>>Is it possible to use both Strut's Validator Framework for some fields
>>and validate other fields using my own validation via ActionForm
>>class. If yes, can someone site an example.
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
Thanks, but sorry but ididnt quite get. Though i dont have an 
application yet for this but what i have in mind is like this.

1.) Form1 action=Form1 - the form for the 2 fields
2.) field 1 - will be initially validated by the Struts framework  then 
passed to my LookupDispatchAction for my db validation
2.) field2  - will be validated using my own ValidatorForm then passed 
to my LookupDispatchAction for more db validation

what should i use on my struts-config, im quite confused now what to use 
on my struts-config?
<form-bean name="Form1"
     	type="org.apache.struts.action.DynaActionForm">
     	<form-property name="fiedl1"
       		type="java.lang.String"
       		initial="testfieldvalue1"/>
	</form-bean>

<action
     	    path="/Form1"
             type="test.Form1Action"
             name="form1Form"
             parameter="method"
             input="/testform.jsp"
             scope="request"
             validate="false">
             <forward name="failure" path="/testform.jsp"/>
             <forward name="success" path="/formsuccess.jsp" />
         </action>

or

<form-bean
             name="inputForm"
             type="test.InputForm"/>

<action
             path="/Form1"
             type="test.InputAction"
             name="inputForm"
             scope="request"
             validate="true"
             input="/input.jsp">
         	<forward name="success" path="/success.jsp"   />
        	</action>

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


Mime
View raw message