U can specify the error page for the failures in struts-config.xml. For example -

 <action path="/getaudit" type="com.test.test1.test2.GetAllRecords" name="getAudit" 
scope="request"     input="/getData.jsp">

    <forward name="success" path="/displaydata.jsp"/>
    <forward name="failure" path="/errorpage.jsp"/>

 </action>

After u get an error in ur action.perform method, get the error text of the exception, 
use
request.setAttribute(errorText) and it will be automatically forwarded to the error 
jsp after u call 

mapping.findForward(FAILURE);

In ur jsp u get this error message by calling
request.getAttribute("error")

I hope this helps,

-Ranjan


-----Original Message-----
From: Bhaskar Gopalan [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 2:50 PM
To: Struts Group (E-mail)
Subject: Displaying error page


Hi,

in the action.perform(), I encounter an error and want to display an error
page along
with a dynamic message. Is there any standard way to do this (just like
displaying
the validation error page)? What other ways are possible?

Thnx,
Bhaskar

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