tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Randolf <>
Subject jsp:setProperty and exceptions
Date Wed, 27 Sep 2000 14:19:56 GMT

i use tomcat 3.1 (jdk 1.3.0beta_refresh) and apache 1.3.12 under linux.

when i try to set a property of a bean with 
<jsp:setProperty .../> and the set method throws an exception, i get an
org.apache.jasper.JasperException with the root cause

throwing an exception (and handling it in an errorpage) in
<jsp:getProperty .../> works fine. it also works when i call the
corresponding set method inside the script (<% %>) tags.

is this a bug, or do i have a buggy setup of tomcat? 

here's some code to verify:

the bean:
public class Test {
	public int getTest() throws Exception {
		throw new Exception();
	public void setTest( int i ) throws Exception {
		throw new Exception();

the jsp
<%@ page language="java" import="Test, CheckException" %>

<jsp:useBean id="t" scope="page" class="Test"/>

<jsp:setProperty name="t" property="test" value="1"/>

<%-- works
<jsp:getProperty name="t" property="test"/>

// works

thanks for any help!


View raw message