On Tuesday 25 February 2003 10:03 am, ROSSEL Olivier wrote:
> I want to display the error message of an SQLException
> in my JSP.
>
> At first, I tried to set an ActionError with this message and
> to display it via <html:errors/>.
> It does not work because ActionError accepts as an input
> string the key of a property.
>
> So what's the nicest way to show to the user the error message
> that I get from my SQLException ?

If you use Struts 1.1, declare an <exception> under <global-exceptions> or an 
<action> in your struts config xml file. You can specify a JSP page to 
forward the request to within the exception element.

You may need to define an ExceptionHandler class that will be passed request, 
response and exception objects if an Action throws an exception. Build any 
response there that's more complex than merely forwarding to a JSP.

Read section 4.5 of the wonderful Struts user guide:
http://jakarta.apache.org/struts/userGuide and read the struts config file's 
DTD - very revealing texts.

Paul

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

Reply via email to