Validation prevents Action from creating session scope object

2004-07-26 Thread Robert Miller
I have a Struts application that acts like a wizard (conditionally
displaying only relevant pages and skipping others based upon previous
user input). One of my pages collects multiple instances of a single
record by allowing data to be entered and displaying previous records in
a table. To accomplish this my Action class queries the contents of the
bean, which is my model, to determine if the JSP it supports should be
displayed.  If the JSP should be displayed, the Action creates necessary
objects (an ArrayList) setting them in the session (under the name of
list) and forwards to the use mapping.  Otherwise the Action
class forwards to the skip mapping, bypassing this page. The JSP uses
the logic:iterate tags to display the contents of list from the
session in a table. When I hit the Add button on the page, the Action
(the same Action mentioned above, it handles both pre and post
processing for the page) takes my form bean and adds it to the ArrayList
and returns to the page where another entry is shown in the list of
records.  My problem is, when I tried to add validation all that I have
described broke. 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 pages that
do not rely on preexisting classes in the session and they are
validating without problems. Thank you for your help.Robert 


RE: Validation prevents Action from creating session scope object

2004-07-26 Thread Jim Barrows

 -Original Message-
 From: Robert Miller [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 26, 2004 10:36 AM
 To: [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Validation prevents Action from creating session scope object

2004-07-26 Thread Robert Miller
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?
 
Thanks,
Robert

 [EMAIL PROTECTED] 7/26/2004 12:43:17 PM 


 -Original Message-
 From: Robert Miller [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 26, 2004 10:36 AM
 To: [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]