You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Canning, Chuck" <ch...@zilliant.com> on 2003/07/22 18:18:26 UTC

Dsiplaying forms without validation

Hi,

I have a series of pages which are used to collection information about a
user. basic registration type stuff. My question is: How do I get Struts to
display my page with the form without performing validation until the form
is submitted? Do I have to create separate action mappings for each page one
with the form and one without. I am new to struts. Oh yeah, I am using
struts 1.1.

Chuck


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


RE: Dsiplaying forms without validation

Posted by Mark Galbreath <ma...@qat.com>.
If you are validating in the ActionForm, don't; validate in the Action
class.

In struts-config.xml make sure the "validate" attribute of the <action path>
tag is "false."

Mark

-----Original Message-----
From: Canning, Chuck [mailto:chuck.canning@zilliant.com] 
Sent: Tuesday, July 22, 2003 12:18 PM
To: 'Struts Users Mailing List'
Subject: Dsiplaying forms without validation


Hi,

I have a series of pages which are used to collection information about a
user. basic registration type stuff. My question is: How do I get Struts to
display my page with the form without performing validation until the form
is submitted? Do I have to create separate action mappings for each page one
with the form and one without. I am new to struts. Oh yeah, I am using
struts 1.1.

Chuck


---------------------------------------------------------------------
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


Re: Dsiplaying forms without validation

Posted by Michael Ruppin <mr...@yahoo.com>.
There are probably more ways, too.  Depending on your
design, I'd recommend Mark's suggestion.  Validation
in the Action makes sense particularly when using a
variant of DispatchAction, wherein there will be many
methods for different submissions, only some of which
require validation, and perhaps differing validation.

m

--- "Jens v.P." <de...@jevopi.de> wrote:
> Hi,
> 
> this question was asked several times before, I also
> asked this 
> questions a week ago. Just have a look at the
> mailing list archive.
> 
> There are two approaches:
> 
> 1) Two actions: "ViewFormFirstTimeAction" with
> validate="false" in the 
> struts-config.xml, and ViewFormAction with
> validate="true"
> 
> 2) Create your own form class (as a subclass of a
> validator form 
> class). Check whether the submit-value is present in
> the quest and, if 
> not, skip super class validation, otherwise call
> super class validation 
> function. Caution: You have to pay attention that in
> the first case 
> your form is not skipped (no error occured and the
> "success" page is 
> forwarded) - you maybe have to add a "firsttime"
> forward or something 
> like this.
> 
> Jens
> 
> BTW: Oh - this question is also listed in the FAQ...
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Re: Dsiplaying forms without validation

Posted by "Jens v.P." <de...@jevopi.de>.
Hi,

this question was asked several times before, I also asked this 
questions a week ago. Just have a look at the mailing list archive.

There are two approaches:

1) Two actions: "ViewFormFirstTimeAction" with validate="false" in the 
struts-config.xml, and ViewFormAction with validate="true"

2) Create your own form class (as a subclass of a validator form 
class). Check whether the submit-value is present in the quest and, if 
not, skip super class validation, otherwise call super class validation 
function. Caution: You have to pay attention that in the first case 
your form is not skipped (no error occured and the "success" page is 
forwarded) - you maybe have to add a "firsttime" forward or something 
like this.

Jens

BTW: Oh - this question is also listed in the FAQ...


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