But, to answer your question, it's a matter of scope. When the page containing the form is first rendered, the hidden variable is set to some value that lives in request scope. When the form is submitted (and validation errors occur), a new request exists, the original request no longer exists, and so that value is no longer in scope when the page is rendered for the second time.
See if this helps:
http://www.reumann.net/struts/articles/request_lists.jsp
Erik
Sebastian Ho wrote:
hi
i have the following codes in my JSP :
<input type="hidden" name="userID" value="<bean:write name="user" property="userID" scope="request"/>"/>
which converts into <input type="hidden" name="userID" value="1"/>.
If validation is used and there are errors, the input page is displayed. Now the above value became :
<input type="hidden" name="userID" value=""/>
The valus is missing..
Can anyone explain why this is happening and how to resolve it?
sebastian
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]