You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2003/12/13 07:44:58 UTC

Form and Session

The statement below in my JSP can write out the value
of the "creator" property in the articleForm:

<bean:write name="articleForm" property="creator"/>

I want to pass the value of the "creator" in a session
object.  What should I do in my JSP? 

<% 
String creator = (String)articleForm.getCreator;
session.setAttribute("creator", creator);
%>

Or, can I pass articleForm in a session object?
<% session.setAttribute("articleForm", articleForm);%>
   



__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Form and Session

Posted by Mark Lowe <ma...@talk21.com>.
If you're determinted to do this in jsp rather than an action servlet 
then

<c:set var="creator" value="${articleForm.creator}" scope="session" />

might do the job. I haven't tried it but I reckon it should work.



On 13 Dec 2003, at 06:44, Caroline Jen wrote:

> The statement below in my JSP can write out the value
> of the "creator" property in the articleForm:
>
> <bean:write name="articleForm" property="creator"/>
>
> I want to pass the value of the "creator" in a session
> object.  What should I do in my JSP?
>
> <%
> String creator = (String)articleForm.getCreator;
> session.setAttribute("creator", creator);
> %>
>
> Or, can I pass articleForm in a session object?
> <% session.setAttribute("articleForm", articleForm);%>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Form and Session

Posted by Navjot Singh <na...@net4india.net>.
try to keep Session as light as possible. With that in mind, just save all
you need, creator in your case, in Session.

Navjot

>-----Original Message-----
>From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
>Sent: Saturday, December 13, 2003 12:15 PM
>To: struts-user@jakarta.apache.org
>Subject: Form and Session
>
>
>The statement below in my JSP can write out the value
>of the "creator" property in the articleForm:
>
><bean:write name="articleForm" property="creator"/>
>
>I want to pass the value of the "creator" in a session
>object.  What should I do in my JSP?
>
><%
>String creator = (String)articleForm.getCreator;
>session.setAttribute("creator", creator);
>%>
>
>Or, can I pass articleForm in a session object?
><% session.setAttribute("articleForm", articleForm);%>
>
>
>
>
>__________________________________
>Do you Yahoo!?
>New Yahoo! Photos - easier uploading and sharing.
>http://photos.yahoo.com/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org