Hi, I'm actually preparing for the SCWCD too, so I may be wrong...
First, the form page has to be trimmed a little to make it usable:
<form action="<path to the servlet you are trying to reach>">
<jsp:useBean id="person" class="test.scwcd.Person" scope="request"/>
<jsp:setProperty name="person" property="name" value="Fred"/>
<input type="submit" name="Submit"/>
</form>
Bun even now, this form actually does submit "nothing", meaning that in the form there isn't any <input> field except for the submit button I added. The jsp:useBean and jsp:setProperty tags have been used within an html <form> tag but that doesn't make any different if they were placed outside of it, because the bean is created and its property set just before the form is returned to the client (jsp code always gets evaluated on server side), and if you look into the html form on the browser you will see that there isn't any info about the bean. The request scoped bean also has already gone out of scope because the http transaction with the server is over by the time the form is displayed on the browser. If you now submit the form a new transaction begins and a new request object will be created, but this time the form has no parameters in it.
I hope this better clarify my point :-)
Originally posted by Sarat Koduri:
Matteo .. is this the case always.. ?? i don't think so.. because.. if we set an attribute in the request scope of the Form and we submit it to the servlet.. i am sure we can retrive it back. isn't it..??
[ October 03, 2008: Message edited by: Sarat Koduri ]