File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes Redirecting to a URL after actionPerformed in Portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "Redirecting to a URL after actionPerformed in Portlet" Watch "Redirecting to a URL after actionPerformed in Portlet" New topic
Author

Redirecting to a URL after actionPerformed in Portlet

Ram Charan
Greenhorn

Joined: Jun 07, 2008
Posts: 16
Hi,

I am new to the portlets development using IBM Websphere. The scenario I have is on a portlet user provides some information and clicks on submit which needs to be be saved in session and should be redirected to a diferent page. Can some one help me on where the action processing needs to be done and how the redirection can be acheived? My portlet class is extending AbstractPortlet and implementing ActionListener.

If I am not wrong, in JSR 168 compliant portal this will be done in processAction method and page redirection cane be done using response.sendRedirect in the same method.

Thanks,
Ram.
Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 44

You are right. You can use Process Action for a JSR portlet. Its called when a Form submit is done. In order to set your values as attributes you can use following code:

//Get HttpRequest Object from the Portal action request

HttpServletRequest request = getHttpServletRequest(actionRequest);

request.setAttribute("parameter", parameter);
Ram Charan
Greenhorn

Joined: Jun 07, 2008
Posts: 16
Thanks Ankur for your response.

But I am using IBM RAD to generate portlet class which creates the class extending AbstractPortlet and implementing ActionListener. In this I cannot find processAction method to override. So how can I implement the scenario in question?

Ram
 
 
subject: Redirecting to a URL after actionPerformed in Portlet
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com