You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Burhan Nazir <bu...@blueyonder.co.uk> on 2003/09/17 18:50:29 UTC

Using DispatchAction class with Struts Validator

Got a problem thats been bugging me for a while:

I'm using an action class that extends DispatchAction class.  The methods in
this class use the same ActionForm class (DynaValidatorActionForm).  However,
the validation requirments for each method in the dispatch class are
different.

I understand that if I use the DynaValidatorActionForm, I can map the action
URI to the name property in the validation.xml file.  Is it possible to map
the exact method in my dispacth to the validation.xml file?

For example, if my DispatchAction class URI path mapping is: "/dispatch", and
I have a method named "update1" and "update2" within the dispatch class, can I do this in
my validation.xml file?:

<formset>
	<form name="/dispatch.do.update1">
	......do special validation here
	</form>
	<form name="/dispatch.do.update2">
	......do special validation here
	</form>
</formset>

Many thanks for your help!
-Burhan




-- 
FreeBSD 4.8-STABLE * http://www.freebsd.org
 5:40PM  up 127 days,  2:09, 11 users, load averages: 0.00, 0.00, 0.00

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


Re: Using DispatchAction class with Struts Validator

Posted by Burhan Nazir <bu...@blueyonder.co.uk>.
Indeed, each dispatch method corresponds to a different jsp page.  However,
the "page" attribute is designed for building up an ActionForm from many
different pages in wizard like way.  I'm looking only to perform a specific
type of validation on a subset of my ActionForm for each dispatch method.

The only other solution I know of is to break up my DispatchAction to
seperate Actions and use seprate ActionForms for each, not something I want
to do unless absolutely necessary!

-Burhan


Mike Jasnowski wrote:

> Do you have corresponding pages for each method? Would the "page" attribute
> enable you to only validate fields relevant to the corresponding dispatch
> method? Or have I missed your question.
> 
> -----Original Message-----
> From: Burhan Nazir [mailto:burhan@blueyonder.co.uk]
> Sent: Wednesday, September 17, 2003 12:50 PM
> To: struts-user@jakarta.apache.org
> Subject: Using DispatchAction class with Struts Validator
> 
> 
> Got a problem thats been bugging me for a while:
> 
> I'm using an action class that extends DispatchAction class.  The methods in
> this class use the same ActionForm class (DynaValidatorActionForm).
> However,
> the validation requirments for each method in the dispatch class are
> different.
> 
> I understand that if I use the DynaValidatorActionForm, I can map the action
> URI to the name property in the validation.xml file.  Is it possible to map
> the exact method in my dispacth to the validation.xml file?
> 
> For example, if my DispatchAction class URI path mapping is: "/dispatch",
> and
> I have a method named "update1" and "update2" within the dispatch class, can
> I do this in
> my validation.xml file?:
> 
> <formset>
> 	<form name="/dispatch.do.update1">
> 	......do special validation here
> 	</form>
> 	<form name="/dispatch.do.update2">
> 	......do special validation here
> 	</form>
> </formset>
> 
> Many thanks for your help!
> -Burhan
> 
> 
> 
> 
> --
> FreeBSD 4.8-STABLE * http://www.freebsd.org
>  5:40PM  up 127 days,  2:09, 11 users, load averages: 0.00, 0.00, 0.00
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

-- 
FreeBSD 4.8-STABLE * http://www.freebsd.org
 6:03PM  up 127 days,  2:33, 11 users, load averages: 0.10, 0.03, 0.01

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


RE: Using DispatchAction class with Struts Validator

Posted by Mike Jasnowski <mj...@bea.com>.
Do you have corresponding pages for each method? Would the "page" attribute
enable you to only validate fields relevant to the corresponding dispatch
method? Or have I missed your question.

-----Original Message-----
From: Burhan Nazir [mailto:burhan@blueyonder.co.uk]
Sent: Wednesday, September 17, 2003 12:50 PM
To: struts-user@jakarta.apache.org
Subject: Using DispatchAction class with Struts Validator


Got a problem thats been bugging me for a while:

I'm using an action class that extends DispatchAction class.  The methods in
this class use the same ActionForm class (DynaValidatorActionForm).
However,
the validation requirments for each method in the dispatch class are
different.

I understand that if I use the DynaValidatorActionForm, I can map the action
URI to the name property in the validation.xml file.  Is it possible to map
the exact method in my dispacth to the validation.xml file?

For example, if my DispatchAction class URI path mapping is: "/dispatch",
and
I have a method named "update1" and "update2" within the dispatch class, can
I do this in
my validation.xml file?:

<formset>
	<form name="/dispatch.do.update1">
	......do special validation here
	</form>
	<form name="/dispatch.do.update2">
	......do special validation here
	</form>
</formset>

Many thanks for your help!
-Burhan




--
FreeBSD 4.8-STABLE * http://www.freebsd.org
 5:40PM  up 127 days,  2:09, 11 users, load averages: 0.00, 0.00, 0.00

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



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