On 5/25/07, mjohnson <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]