Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing render parameters to doView

 
vijay sag
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm setting render paramater in process actions as below.

public void processAction(ActionRequest request, ActionResponse response) throws PortletException {

response.setRenderParameter("strOrderId", "X1234");
super.processAction(request, response);

}

And trying to retrieve the above render paramater in doview method.

public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
response.setContentType(request.getResponseContentType());
response.getWriter().println("Render parameter" + request.getParameter("strOrderId"));

super.doView(request, response);
}


But I'm not able to retrieve this paramter in doView method. I researched in forums and in some threads its given that we can pass information to doView through render paramaters.

I'm using JSF JSR 168 portlets and portal version is 6.1.0.5.

Could you please let me know whether im passing and retreiving the paramaters in right way?

Thanks,
Vijay.





 
George Stafford
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way I found that worked for me was in the action to do the following:

actionRequest.getPortletSession().setAttribute("strOrderId", "X1234");


Then in the doView you can retrieve it from the portlet session:

request.getPortletSession().getAttribute("strOrderId")

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic