tags:

views:

561

answers:

1

Hi Guys,

I have a simple HTML page which contains a form with GET method, whose action is a portal page containing a JSF portlet.I need to access the parametrs passed in to the portal page in my portlet? How can I achieve this?

I have tried to access the parameter "code" on the view page using following code but the value comes up as null.

java.util.Map requestMap = javax.faces.context.FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); String code = requestMap.get("code");

At some other forum it was suggested that I need to pass the the portlet id as request parameter in order to have the portlet access to passed request parameters. If that is true where/how can I lookup my portlet ID so that portlet has access to request parameters.

Thanks in advance!!!

+2  A: 

I would look into whether the WebSphere implementation of public render parameters supports this. If the ExternalContext request parameter map does not expose these values, you can cast the request to a PortletRequest and make use of the Map<String,String[]> getPublicParameterMap() method.

McDowell
At what place the casting shall be done? I believe it has to be done before the portlet's view page is rendered. As once the view page is rendered, the request parameters are already lost.
Zaheer Baloch