You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Suriyanarayanan, Senthil Kumar" <se...@capitalone.com> on 2001/07/03 16:04:41 UTC

No struts trace if JspException is detected by the errorPage dire ctive..

Hello,
	My errorpage.jsp (which is mentioned as the errorPage directive on
all the jsps) does not show any struts trace if an JspException is thrown by
struts layer..

	If I remove the errorpage directive on the problematic jsp, the
stack trace on the console is ..

javax.servlet.jsp.JspException: Exception creating bean of class
com.xyz.MyForm: java.lang.ClassNotFoundException: com.xyz.MyForm
        at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568)
        at
jsp_servlet._registration._registrationtermsandcondition._jspService(
_registrationtermsandcondition.java:137)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:213)
        at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
cherImpl.java:157)
        at
org.apache.struts.action.ActionServlet.processActionForward(ActionSer
vlet.java:1758)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:159
5)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:213)
        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1265)
        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1622)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
-----------------
My errorpage.jsp is coded as ..

<%@ page language="java" 
	isErrorPage="true" %>


<%@ taglib uri="struts-html.tld" prefix="html" %>
<%@ taglib uri="struts-bean.tld" prefix="bean" %>



<html:html>  
<title>Error Page </title>
<body>
	Uncaught Exceptions makes this page show up!!!
<% Throwable strutsException = (Throwable) request.getAttribute
("org.apache.struts.action.EXCEPTION"); %>
<% if ( strutsException != null ) 
	{%>
		<p>Struts trace was: <br><pre>
		<%=getStackTraceAsString(strutsException)%><b>
	<%} 
	else 
	{%>	<p>No Struts trace
	<%}%>

<%! String getStackTraceAsString(Throwable e) 
	{ 
		ByteArrayOutputStream ostr = new ByteArrayOutputStream();
		e.printStackTrace(new PrintStream(ostr));
return(ostr.toString()); 
	} 
%> 
	
</body>
</html:html>


---------------

How do I capture/display the above exception either in the stack trace or
the errorpage.jsp?

Thanks
Senthil Kumar.S
 
**************************************************************************
The Information transmitted herewith is sensitive information intended only
for use to the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon, this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.