> -----Original Message-----
> From: Denise Mangano [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 10, 2003 5:02 PM
> To: 'Tomcat Users List'
> Subject: RE: Java Bean Scope questions (a lengthy one)
>
>
[snip]
> Basically what I am looking to do is once the HTML form is
> submitted, and the call to CCProcess.jsp is executed (where I
> have my <jsp:setProperty> tag), I want ALL bean variables
> over written. I thought that this is what is happening when I use:
>
> <jsp:useBean id="formBean" class="com.Greenwich.beans.FormBean"
> scope="session"/>
> <jsp:setProperty name="formBean" property="*"/>
>
> But apparantley, when the field is left blank it isn't
> "writing" an empty string back to the bean so the previous
> value is recalled. I would like all variables, blank and
> completed fields to be written back.. The only way I could
> think to accomplish this is with a lot of code and addressing
> each property separately, for example something to the effect of
>
> <jsp:setProperty name="formBean" property="*"/>
> <%
> if (request.getParameter("name") == null) //or is it == ""
> formBean.setName("");
> if (request.getParameter("address") == null)
> formBean.setAddress("");
> .....
> %>
>
> I would imagine this would be work, but I would also imagine
> there is an easier way and I'm hoping that someone here will know :)
Here's a thought. You could define a "reset" method on your form bean
that blanks out all of the properties. Then:
<jsp:useBean id="formBean" class="com.Greenwich.beans.FormBean"
scope="session"/>
<% formBean.reset(); %>
<jsp:setProperty name="formBean" property="*"/>
--
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>