Thank you!! Thank you!! Thank you!! 

Tim -
The reset worked like a charm.  Thank you very much for ALL your help!!  I
could not find a single other problem with this form validation, so it looks
like this is it!! (keeping fingers crossed)

I ended up resetting the index first thing in the validate method and that
works.  I agree with your mention of the Iterator class, but for now I want
to get the rest of my app completed then will look into that when I go back
for fine tuning.

Thanks again!!!
Denise

-----Original Message-----
From: Tim Moore
To: Tomcat Users List
Sent: 1/10/2003 5:21 PM
Subject: RE: Java Bean Scope questions (a lengthy one)

> -----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]>

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

Reply via email to