Hello all --
I'm looking for some guidance in handling Custom errors in my app. I can't
seem to find the message string of my custom exception when trying to call
my JSP Error page. I'm consistently getting:
javax.servlet.jsp.JspTagException: runtime failure in custom tag
'CalendarHandler' .
I am using custom JSP tag libraries to process logic on my EJBs. When I
reach an error in business logic I raise a custom exception and propogate
this back up to doStartTag:
public int doStartTag() throws JspException {
CalendarProcessor cp = new CalendarProcessor();
try {
String eventAction = getEventID();
// pageContext contains information for the JSP;
// Initialize the page with the current context and session
cp.init(pageContext.getServletContext(),
pageContext.getSession());
HttpServletRequest req =
(HttpServletRequest)pageContext.getRequest();
cp.processRequest(req, eventAction );
} catch (CalendarException ce) {
throw new JspException(ce.getMessage());
}
return SKIP_BODY;
}
Then, in my JSP, I am enclosing the TagHandler in a try...catch block; I
can't catch CalendarException because it is Throwable and conflicts with
JspException.
<% try { %>
<gtc:CalendarHandler eventID="updatecal"/>
<% } catch (Exception e) {
throw e instanceof JspException ? (JspException) e : new
JspTagException(e.getMessage());
}
%>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets