struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Barrows" <jbarr...@sssc.com>
Subject RE: Validation prevents Action from creating session scopeobject
Date Mon, 26 Jul 2004 17:59:21 GMT


> -----Original Message-----
> From: Robert Miller [mailto:rmiller@ofumic.com]
> Sent: Monday, July 26, 2004 10:50 AM
> To: user@struts.apache.org
> Subject: RE: Validation prevents Action from creating session
> scopeobject
> 
> 
> Thanks for the information.
>  
> I have been trying to keep my validation in one place
> (validation.xml).
> Is it possible to have a page that validates through XML be entered
> (and initialized) through an Action?

> And if so how?

<action path="/showDaPage" type="package.path.to.Action" name="ActionForm" input="/whereItCameFrom.do"
validate="false">
			<forward name="success" path="page.jsp"></forward>
</action>

<action path="/mungDaPage" type="package.path.to.Action" name="ActionForm" input="/showDaPage.do"
validate="true">
			<forward name="success" path="daPageWotMungedGood.jsp"></forward>
</action>

Note, that the type= is not accidently the same thing.  I don't know how you tell the action
if it's setting up the page, or processing the page so can't help you there, but that's the
gist of it.

The key here is that this maps a URI to a java class that extends the Action class.  There
is no law ( well except for maybe the Law of Common Sense) against having more then one mapping
to a single class.  In fact the ForwardAction kind of depends on it.

>  
> Thanks,
> Robert
> 
> >>> jbarrows@sssc.com 7/26/2004 12:43:17 PM >>>
> 
> 
> > -----Original Message-----
> > From: Robert Miller [mailto:rmiller@ofumic.com]
> > Sent: Monday, July 26, 2004 10:36 AM
> > To: user@struts.apache.org
> > Subject: Validation prevents Action from creating session scope
> object
> > 
> > 
> 
> <snip>
> > The browser displays "Error 500: Cannot find bean list
> > in any scope".  It is acting as though validation is 
> > bypassing my action
> > (and my initialization code) and going directly to the page.  Is
> this
> > possible? Do I have something configured wrong? I have other 
> 
> Validation happens before the action is called, so yes it is 
> possible. 
> You can control validation through the action mapping in
> struts-config.xml, or you can play with the validation method on the
> form bean.
> 
> > pages that
> > do not rely on preexisting classes in the session and they are
> > validating without problems. Thank you for your help.Robert 
> > 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message