tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Niyazov <>
Subject Re: JSP / JavaBean problem
Date Thu, 05 Jul 2001 21:44:47 GMT
According to JSP specs if you're attemting to initialize a bean property from a 
request parameter that does not exist or is defined as an empty value then 
<jsp:setProperty> command has no effect: the tag is just ignored. More exactly 
(from the JSP 1.1 spec):
"If the param is not set in the Request object, or if it has the value of "", 
the jsp:setProperty element has no effect (a noop)"

* Boris Niyazov                Ph:  212-854-4094  Fax: 212-854-1749 *
* Systems Manager              Email:             * 
* Columbia Law School          URL:     *

>Hi, I'm new to this list, and hope this is the appropriate forum.  Kick me
>over to a developer forum if not...
>I am developing JSPs with JavaBeans and have run into an issue with "blank"
>input fields on the form.  An empty string, "", is NOT passed to the setter
>method on my beans.  I have researched the source code in
> and found the introspect (Tomcat 3.1) /
>introspectHelper (Tomcat 3.2.1) method intentionally excludes parameters
>that have a NULL or "" value - of course NULL could never happen because of
>the flow of the code, but never mind that.
>I guess my question is this.  Is this correct functionality.  I have read
>the JSP 1.1 specification on the topic of the setProperty tag, and it is NOT
>specific regarding this matter.  It is a huge problem for me because I have
>beans that have a session scope and a particular property of the bean may be
>"Fred" but if I blank out the related input field it doesn't overwrite the
>value in the bean when I submit the form.  Hope this makes sense.
>Any and all help would be appreciated.
>Michael W. Housman Jr.
>Optimal Systems Design, Inc.
>Consulting at Wells Fargo Services Company
>Phone:  612.341.9784
>Cell:   612.386.6785
>Office: 763.537.2631

View raw message