tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean" <>
Subject Setter Method Exceptions
Date Tue, 30 Jan 2001 23:03:13 GMT

I have a custom tag nested within an iterator tag that formats elements in a long table. The
performance is really poor. The tag's attributes change by session and request, but remain
constant within the loop. I have a couple of questions:

1) Is it acceptable for a setter method of a tag handler to declare and throw a JspException?
The specs seem to say that it is, but the tag examples that I've seen so far (not a lot) all
do validation of run-time attributes within the doStartTag method. The container that I use
just puts a large try/catch block around the page content, but I wonder if others may have
a problem with it?

2) I thought if 1 is OK, then moving as much as possible to the setter methods would help
performance in loops since the tag interface says that a container can set the attributes
values once (outside the loop in my case?) and then call the doStartTag multiple times. Do
any of the current JSP precompilers take advantage of this? Mine doesn't seem to.

I've speeded it up for now by putting most of the logic in a bean so I can setProperties outside
the loop and then just pass the bean id to the tag within the loop, but I would be simpler
if I could use the method above.

TIA very much for any help.


View raw message