Hi!
This is probably a missing feature in the portlet framework. The
SessionAware interface aparently doesn't work when inside a portlet.
The other approach you use should work, but if it doesn't, try using
the ActionContext to get the session map and put it there.
Nils-H
On 3/16/07, tom tom <[EMAIL PROTECTED]> wrote:
Hi,
I implemented the following interface
org.apache.struts2.interceptor.SessionAware;
hence implemented the
public void setSession(Map session) method and did add
the following attribute
session.put("NAME","USER1");
and in my jsp I have the following
<s:property value="#session.NAME"/> <br>
It works fine in a normal struts Web Application.
But when I did the same in a Portlet Application, the
jsp does not print the value. Should I do any
additional steps, I was under the impression we can
write a portlet as similar to a web application.
After that I tried the following
RenderRequest req =
PortletActionContext.getRenderRequest();
PortletSession session1=req.getPortletSession();
session1.setAttribute("NAME","USER1");
but still jsp does not print the session values.
Can some one let me know how to proceed ont this.
thanks
--- Nate Drake <[EMAIL PROTECTED]> wrote:
> Have your action implement SessionAware, and give it
> a setter of the form:
>
> public void setSession(Map session);
>
> You can then add things to this map, and they will
> be added into the session.
> Then you can access them in your JSP like this:
>
> <s:property value="#session\['NAME'\]"/>
>
>
> See these pages for more details:
>
>
http://struts.apache.org/2.0.6/docs/how-do-we-get-access-to-the-session.html
>
http://struts.apache.org/2.0.6/docs/application-session-request-objects-in-jsp.html
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
---------------------------------------------------------------------
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]