File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Global excpetion-getting print stack trace? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Global excpetion-getting print stack trace?" Watch "Global excpetion-getting print stack trace?" New topic
Author

Global excpetion-getting print stack trace?

sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130
Hi,
I am trying to get print stack trace from exception object i am throwing from the action class, which was declared in the global-exception section of the struts-config.xml file.When i get exception,it is forwarding to error.jsp and printing message from Application.resourceProperties file. But i also want to print Exception message on the error.jsp and the stack trace.I have exception object in the request scope .Please see the sample code

Struts-config.xml :

<global-exceptions>
<exception key="errors.nullpointer" type="java.lang.NullPointerException" path="page.error" scope="request"/>
<exception key="errors.exception" type="java.lang.Exception" path="page.error" scope="request" />
</global-exceptions>

//error.jsp

<HTML>
<BODY>
<%@ page isErrorPage="true" %>

<P>
reported the following error:

<logic:messagesPresent>
<UL>
<html:messages id="error">
<LI><font color="RED"><bean:write name="error" /></font></LI>
</html:messages>
</UL>
</logic:messagesPresent>

</BODY></HTML>

Thanks
Sudhakar
sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130
I still waiting trying to solve this, any help please?

-Sudhakar
sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130
The current jsp page is showing a message from Application properties file.
I am trying to print generic message on error page. If I put the following line in error.jsp i am getting [ServletException in:/error.jsp]null message.

<font color="red">
<%= exception.toString() %><br>
</font>

-Sudhakar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Global excpetion-getting print stack trace?
 
Similar Threads
Printing Error Stack Trace in JSP
How to transport the stacktrace of an Exception from a Action to a Error-JSP?
server side validation errors
Form is not being validated
Validation framework is not working