Bug 8278 - <c:set> catches exceptions instead of propagating them
Summary: <c:set> catches exceptions instead of propagating them
Status: CLOSED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 blocker (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-18 21:54 UTC by Hans Bergsten
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 Hans Bergsten 2002-04-18 21:54:04 UTC
Build: 4/18, nightly

This page:

<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<%!
  public class MyBean {
    public String getThrowException() {
      if (true) {
        throw new RuntimeException("Hey!");
      }
      return "";
    }
  }
%>
<%
  pageContext.setAttribute("myBean", new MyBean());
%>

<c:set var="foo" value="${myBean.throwException}" />
<c:out value="${foo}" /> 

results in the exception thrown my the getThrowException() method to captured
and saved in the variable "foo", instead of propagating the exception.
Comment 1 Shawn Bayern 2002-04-18 22:33:52 UTC
This was a bug in the EL evaluator; fixed by throwing instead of returning 
exception.