Bug 9219

Summary: in catch if a servlet exception is thrown it is not held by the variable defined
Product: Taglibs Reporter: Prasad Subramanian <prasad.subramanian>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Prasad Subramanian 2002-05-18 03:09:18 UTC
let say we have a tag:
<c:catch var="foo" >
 0000
</c:catch>
If a servlet exception is thrown it is not captured by teh variable and a <%
pageContext.getAttribute("foo") %> returns a null.
Comment 1 Shawn Bayern 2002-05-18 05:12:20 UTC
What is the actual code you're using?  The following works for me:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<c:catch var="foo">
  <% if (1==1) throw new javax.servlet.ServletException("foo"); %>
</c:catch>
<%= pageContext.getAttribute("foo") %>

That is, it prints out

javax.servlet.ServletException: foo

Thus, I don't believe there is a bug as general as you describe.  Is there a 
more specific bug?