You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by jo...@hawkinsweb.co.uk on 2005/10/18 15:39:27 UTC
Get portletRequest from httpServletRequest
I have a struts action class implemented using struts-bridges. I need to
retrieve the portletRequest object within one of my methods but only have
the httpServletRequest available.
Are there any class utils to do this ?
Thanks
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: Get portletRequest from httpServletRequest
Posted by Jonathan Hawkins <jo...@hawkinsweb.co.uk>.
Thanks for that Ate, and yes it is paramount that we stick to JSR-168.
The problem is that as JSR-168 does not include inter-portlet
communication I suspect that there will be many different solutions,
what a shame !!
The portlet messaging library that I'm looking at to me seems well
thought out and ready to use in my scenarios. I just need to get to the
PortletRequest.
Thanks, as always
Jon
Ate Douma wrote:
>Guys,
>
>Please, please, if you are doing portlets do read the JSR-168 spec...
>A lot, if not most of the answers to these type of questions can be
>found right there.
>
>For this one, read: PLT.16.3.2 Included Request Attributes:
><snip>
>In addition to the request attributes specified in Servlet Specification
>2.3, SRV.8.3.1 Section, the included servlet or JSP must have the
>following request attributes set:
>Request Attribute Type
>javax.portlet.config javax.portlet.PortletConfig
>javax.portlet.request javax.portlet.RenderRequest
>javax.portlet.response javax.portlet.RenderResponse
></snip>
>
>The RequestContext attribute mentioned by Amit is a Jetspeed Portal
>specific attribute and *not* from the JSR-168.
>Make sure you really, really need it before you start hacking into it.
>
>Regards, Ate
>
>jonathan.hawkins@hawkinsweb.co.uk said:
>
>
>>Thanks for that, will take a look.
>>
>>I\'m looking at this as I\'m also looking at
>>
>>http://www.doc.ic.ac.uk/~mo197/portlets/portlet_messaging/crosscontext.php
>>
>>This library needs to get hold of the PortletRequest.
>>
>>Hope that helps understand the problem
>>
>>Jon
>>
>>
>>
>>
>>>I dont know how to do stuff with portletRequest. However I do use
>>>\"requestContext\" to put some data in jetspeed session. I dont know if
>>>that would help you. Look at the api of the RequestContext object.
>>>
>>>There is always an attribute named RequestContext.REQUEST_PORTALENV in
>>>the HttpServletRequest that you get in your struts action.
>>>
>>>org.apache.jetspeed.request.RequestContext requestContext =
>>>(RequestContext) request
>>> .getAttribute(RequestContext.REQUEST_PORTALENV);
>>>
>>>HTH,
>>>Amit
>>>
>>>----Original Message Follows----
>>>From: <jo...@hawkinsweb.co.uk>
>>>Reply-To: \"Jetspeed Users List\" <je...@portals.apache.org> To:
>>><je...@portals.apache.org>
>>>Subject: Get portletRequest from httpServletRequest
>>>Date: Tue, 18 Oct 2005 13:39:27 -0000 (GMT)
>>>
>>>I have a struts action class implemented using struts-bridges. I need
>>>to retrieve the portletRequest object within one of my methods but only
>>>have the httpServletRequest available.
>>>
>>>Are there any class utils to do this ?
>>>
>>>Thanks
>>>
>>>Jon
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>>>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>>>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
RE: Get portletRequest from httpServletRequest
Posted by Ate Douma <at...@douma.nu>.
Guys,
Please, please, if you are doing portlets do read the JSR-168 spec...
A lot, if not most of the answers to these type of questions can be
found right there.
For this one, read: PLT.16.3.2 Included Request Attributes:
<snip>
In addition to the request attributes specified in Servlet Specification
2.3, SRV.8.3.1 Section, the included servlet or JSP must have the
following request attributes set:
Request Attribute Type
javax.portlet.config javax.portlet.PortletConfig
javax.portlet.request javax.portlet.RenderRequest
javax.portlet.response javax.portlet.RenderResponse
</snip>
The RequestContext attribute mentioned by Amit is a Jetspeed Portal
specific attribute and *not* from the JSR-168.
Make sure you really, really need it before you start hacking into it.
Regards, Ate
jonathan.hawkins@hawkinsweb.co.uk said:
> Thanks for that, will take a look.
>
> I\'m looking at this as I\'m also looking at
>
> http://www.doc.ic.ac.uk/~mo197/portlets/portlet_messaging/crosscontext.php
>
> This library needs to get hold of the PortletRequest.
>
> Hope that helps understand the problem
>
> Jon
>
>
>> I dont know how to do stuff with portletRequest. However I do use
>> \"requestContext\" to put some data in jetspeed session. I dont know if
>> that would help you. Look at the api of the RequestContext object.
>>
>> There is always an attribute named RequestContext.REQUEST_PORTALENV in
>> the HttpServletRequest that you get in your struts action.
>>
>> org.apache.jetspeed.request.RequestContext requestContext =
>> (RequestContext) request
>> .getAttribute(RequestContext.REQUEST_PORTALENV);
>>
>> HTH,
>> Amit
>>
>> ----Original Message Follows----
>> From: <jo...@hawkinsweb.co.uk>
>> Reply-To: \"Jetspeed Users List\" <je...@portals.apache.org> To:
>> <je...@portals.apache.org>
>> Subject: Get portletRequest from httpServletRequest
>> Date: Tue, 18 Oct 2005 13:39:27 -0000 (GMT)
>>
>> I have a struts action class implemented using struts-bridges. I need
>> to retrieve the portletRequest object within one of my methods but only
>> have the httpServletRequest available.
>>
>> Are there any class utils to do this ?
>>
>> Thanks
>>
>> Jon
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
RE: Get portletRequest from httpServletRequest
Posted by jo...@hawkinsweb.co.uk.
Thanks for that, will take a look.
I'm looking at this as I'm also looking at
http://www.doc.ic.ac.uk/~mo197/portlets/portlet_messaging/crosscontext.php
This library needs to get hold of the PortletRequest.
Hope that helps understand the problem
Jon
> I dont know how to do stuff with portletRequest. However I do use
> "requestContext" to put some data in jetspeed session. I dont know if
> that would help you. Look at the api of the RequestContext object.
>
> There is always an attribute named RequestContext.REQUEST_PORTALENV in
> the HttpServletRequest that you get in your struts action.
>
> org.apache.jetspeed.request.RequestContext requestContext =
> (RequestContext) request
> .getAttribute(RequestContext.REQUEST_PORTALENV);
>
> HTH,
> Amit
>
> ----Original Message Follows----
> From: <jo...@hawkinsweb.co.uk>
> Reply-To: "Jetspeed Users List" <je...@portals.apache.org> To:
> <je...@portals.apache.org>
> Subject: Get portletRequest from httpServletRequest
> Date: Tue, 18 Oct 2005 13:39:27 -0000 (GMT)
>
> I have a struts action class implemented using struts-bridges. I need
> to retrieve the portletRequest object within one of my methods but only
> have the httpServletRequest available.
>
> Are there any class utils to do this ?
>
> Thanks
>
> Jon
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
RE: Get portletRequest from httpServletRequest
Posted by Shah Amit <am...@hotmail.com>.
I dont know how to do stuff with portletRequest. However I do use
"requestContext" to put some data in jetspeed session. I dont know if that
would help you. Look at the api of the RequestContext object.
There is always an attribute named RequestContext.REQUEST_PORTALENV in the
HttpServletRequest that you get in your struts action.
org.apache.jetspeed.request.RequestContext requestContext = (RequestContext)
request
.getAttribute(RequestContext.REQUEST_PORTALENV);
HTH,
Amit
----Original Message Follows----
From: <jo...@hawkinsweb.co.uk>
Reply-To: "Jetspeed Users List" <je...@portals.apache.org>
To: <je...@portals.apache.org>
Subject: Get portletRequest from httpServletRequest
Date: Tue, 18 Oct 2005 13:39:27 -0000 (GMT)
I have a struts action class implemented using struts-bridges. I need to
retrieve the portletRequest object within one of my methods but only have
the httpServletRequest available.
Are there any class utils to do this ?
Thanks
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org