Hi,

if you have a clear entrance- and exit-point for your form (always enter through 
the same action and process only within on e action, not allowing to
jump away) you could create the list, put it into the session in the entry-action
and from then on just fetch it from the session. When the form is processed remove
the list from the session...

hope this helps
Alexander Jesse

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 12, 2001 1:06 AM
To: [EMAIL PROTECTED]
Subject: Help:Handling Exceptions within Formbean Validate ???


Hi,

With struts how is one supposed to handle exceptions which are caught within 
the validate method of a formbean?  That is, how can you from here go to 
ones generic error page?

Background - I have a case where the form (eg create new X) has some pull 
down lists which are dynamically generated.  If the validate for the form 
fails therefore and I need to go back to the input jsp page with error, I DO 
NEED TO re-extract the dynamic pull down list data from within the validate 
method before it finishes (unless there is a better way?).  If the database 
is down during this phase however an exception is caught within the validate 
method.  Also as my JSP page expects the data present I get a null pointer 
exception in this situation hence the need to redirect to the normal error 
page I use for exceptions.  Question is how to make this happen from within 
the validate method of the formbean?

Any advice welcome.

PS - I tried including a *.do for the input mapping, rather than the .jsp 
mapping, however the problem here the recent changes in the form (eg if you 
were doing an edit form) are not remembered.  Eg if title was "xyz", then I 
changed it to "", this causes a validation error but when going back to the 
page via the action (cf directly to JSP) the end result is "xyz" is 
displayed not "".

Regards
Greg

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to