You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mjohnson <mj...@skillsoft.com> on 2007/05/24 23:59:10 UTC

Struts2 Portlet support

I also posted this in the WebWork forum.

We have succesfully developed a large application that supports milllions of
users with WebWork 2.2.4. It has worked great. This application is comprised
of many independent "panels" that are invoked using the "Page-Controller"
pattern as defined in the Lightbody/Carreira book. Since these panels are
basically HTML fragments, I want to reuse the same code to create portlets
for some of these panels. When invoked from the 168Dispatcher, I do not have
access to the HTTPRequest object in the Action class for each panel. So, how
do I get access to:
1) URL parameters
2) Browser info
3) Session attributes
4) Request header info

I do not see this in the examples or docs. Thanks. 
-- 
View this message in context: http://www.nabble.com/Struts2-Portlet-support-tf3813028.html#a10793525
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2 Portlet support

Posted by Don Brown <do...@gmail.com>.
On 5/25/07, mjohnson <mj...@skillsoft.com> wrote:
>
> I also posted this in the WebWork forum.
>
> We have succesfully developed a large application that supports milllions of
> users with WebWork 2.2.4. It has worked great. This application is comprised
> of many independent "panels" that are invoked using the "Page-Controller"
> pattern as defined in the Lightbody/Carreira book. Since these panels are
> basically HTML fragments, I want to reuse the same code to create portlets
> for some of these panels. When invoked from the 168Dispatcher, I do not have
> access to the HTTPRequest object in the Action class for each panel. So, how
> do I get access to:
> 1) URL parameters

If you were writing the application the WebWork 2 way, you should have
getters/setters for each parameter you need from the request.  Since
WebWork would call those for you, you wouldn't need to access the
request parameters directly.  Still, if for whatever reason that isn't
enough, use ActionContext.getContext().getParameters()

> 2) Browser info

For this, you'll need to access the request, be it servlet or portlet,
directly.  I'd probably have a class that abstracts this for me that
would use either ServletActionContext and PortletActionContext,
whichever is applicable to the situation.

> 3) Session attributes

A couple ways: implement SessionAware and get a map or use
ActionContext.getContext().getSession().

> 4) Request header info

See 2)

> I do not see this in the examples or docs. Thanks.

I agree we should address this more directly in the documentation.
Perhaps if you get your application working, you could contribute? :)

Don


> --
> View this message in context: http://www.nabble.com/Struts2-Portlet-support-tf3813028.html#a10793525
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


RE: Struts2 Portlet support

Posted by "Raghupathy, Gurumoorthy" <Gu...@nielsen.com>.
Try struts tiles :) 

-----Original Message-----
From: mjohnson [mailto:mjohnson@skillsoft.com] 
Sent: 24 May 2007 22:59
To: user@struts.apache.org
Subject: Struts2 Portlet support


I also posted this in the WebWork forum.

We have succesfully developed a large application that supports
milllions of
users with WebWork 2.2.4. It has worked great. This application is
comprised
of many independent "panels" that are invoked using the
"Page-Controller"
pattern as defined in the Lightbody/Carreira book. Since these panels
are
basically HTML fragments, I want to reuse the same code to create
portlets
for some of these panels. When invoked from the 168Dispatcher, I do not
have
access to the HTTPRequest object in the Action class for each panel. So,
how
do I get access to:
1) URL parameters
2) Browser info
3) Session attributes
4) Request header info

I do not see this in the examples or docs. Thanks. 
-- 
View this message in context:
http://www.nabble.com/Struts2-Portlet-support-tf3813028.html#a10793525
Sent from the Struts - User mailing list archive at Nabble.com.


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


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