Bug 9219 - in catch if a servlet exception is thrown it is not held by the variable defined
Summary: in catch if a servlet exception is thrown it is not held by the variable defined
Status: RESOLVED WORKSFORME
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-18 03:09 UTC by Prasad Subramanian
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?