I have a JSP that uses a bean to initialize it's form
fields. When the form is submitted to another JSP,
I include the following to store the request parameter
values into the bean:
<!-- Make sure bean is populated with request data -->
<jsp:useBean id="mbean" class="..." scope="session"/>
<jsp:setProperty name="mbean" property="*"/>
Now, say I enter 'Bill' in a text input field, then
submit the form. The value 'Bill' gets stored in the
corresponding bean property as expected. I then validate
the form fields, and if an error is detected, I redisplay
the form, using the current bean property values to initialize
each for m field (e.g., using <jsp:getProperty...>. If
I then change the field from 'Bill' to 'William', the
bean is updated as expected, and all is well. However, if I
simply clear the field (i.e., delete all characters), then
bean property value is NOT reset. When I redisplay the form, the
previous value is displayed. It appears that if a form field
is blank, the bean property is left unchanged. Is this
the expected behavior, or is this a bug? I'm running JWS 2.0 beta.
I'd like the field to be set to 'null' in this case. Any
suggestions on how to handle this without explicitly writing
a Java scriptlet to do this? Thanks.
-- Bill
--
Bill O'Keefe [EMAIL PROTECTED]
Open Market, Inc. http://www.openmarket.com/
One Wayside Road TEL: 781.359.7296
Burlington, MA 01803 FAX: 781.359.8200
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".