You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Deepa Khetan <de...@gmail.com> on 2005/10/27 10:52:29 UTC
Problem with request.setAttribute
Hi,
I have a observed a peculiar behaviour with Struts. We cannot use
request.setAttribute() while passing values from JSP to Action class. It
works fine if i do it from Action to JSP. but when i use it in JSP and
retreive value in Action class, it results in null. Can anyone please
explain why this happens?
Deepa
Re: Problem with request.setAttribute
Posted by ra...@tcs.com.
Hi,
When you use request.setAttribute() in Action, it is the same
request which goes to JSP also. So, you are able to get the values in JSP
through request.getAttribute(). But when you use request.setAttribute() in
JSP and submit the form, then a new request is generated with the values
that are contained in the current form and that new request erases all the
previous values. If you want to use these values in the Action also, you
need to set them to session rather than request.
Regards,
Rajasekhar Cherukuri
Deepa Khetan <de...@gmail.com>
10/27/2005 02:22 PM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>
To
user@struts.apache.org
cc
Subject
Problem with request.setAttribute
Hi,
I have a observed a peculiar behaviour with Struts. We cannot use
request.setAttribute() while passing values from JSP to Action class. It
works fine if i do it from Action to JSP. but when i use it in JSP and
retreive value in Action class, it results in null. Can anyone please
explain why this happens?
Deepa
ForwardSourceID:NT00006B3E
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you