Hi,
I have a problem that has arisen in Migrating JSP Custom tag code from
tomcat 4.0.3 to tomcat 4.1.12. It seems that when an exception is caught
inside a JSP Tag with TryCatchFinally Interface implmented, the rest of
the page will not render after the tag. Am I missing something obvious,
shouldn't the rest of the page render?
It seems the rest of the page should still render even after the
exception is caught by doCatch(...), This seems to work on 4.0.3 but not
on 4.1.12, is there something I am missing?
Thanks for your help.:-)
-Mark
In terms of the simplest case the jsp and tag code looks like the following:
<%@page contentType="text/html"%>
<%@taglib uri="/thedata-taglib-conditional-0.1" prefix="cond"%>
<html>
<head><title>Exception Taglib Example.</title></head>
<body>
<cond:test>
<!-- test content -->
<%
if(request.getParameter("throw") != null){
throw new java.lang.Exception("Message from Exception");
}
%>
Successfully completed test block.<br/>
</cond:test>
<P/>
test
</body>
</html>
> package edu.harvard.hmdc.taglib.conditional;
>
> import javax.servlet.jsp.tagext.*;
> import javax.servlet.jsp.*;
> import javax.servlet.ServletRequest;
> import java.io.PrintWriter;
> import java.io.IOException;
> public class TestTag extends BodyTagSupport implements
javax.servlet.jsp.tagext.TryCatchFinally{
>
> public int doStartTag() throws JspException, JspException {
> return EVAL_BODY_BUFFERED;
> }
> public int doEndTag() throws JspException, JspException {
> return EVAL_PAGE;
> }
>
> public int doAfterBody() throws JspException {
> BodyContent bodyContent = getBodyContent();
> JspWriter out = bodyContent.getEnclosingWriter();
>
> bodyContent.writeOut(out);
> bodyContent.clearBody();
>
> return SKIP_BODY;
> }
>
> public void doCatch(Throwable t) throws Throwable {
System.out.println("Caught:" + t.getClass().getName());
> }
> public void doFinally() {
> }
>
> }
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>