On further reflection, perhaps target should be set to "" instead of null to maintain exception consistency...

Kris Schneider wrote:
http://issues.apache.org/bugzilla/show_bug.cgi?id=33934

After some thought, here's why I think we can actually set the target property to null in doEndTag (or doFinally, if we add it) instead of release.

If a request-time value is used (scriptlet expression or EL), then the spec requires that the container must reset the property's value between all reuses. In other words, setTarget should be called each time the tag is (re)used.

If a literal value is used, then the container is not required to reset the property's value. First, there's type conversion to deal with. However, since the property's type is Object, a new String instance will be used. In turn, this will cause doEndTag to throw an exception because String does not expose any writable Bean properties.

So, AFAICT, the only way to get a valid value for target is with a request-time value.

Feedback?

P.S.
This is in the context of JSP 2.0 and JSTL 1.1. It may still hold true for JSP 1.2 and JSTL 1.0, even for different reasons ;-), but I haven't thought much about it...

--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to