To retrieve JSR 168 Portlet URL Parameters; you have one of three choices (as far as I know):
Creating a filter on Websphere Application Server level and configuring Dynamic Cache to store the query string then you will be able to get any parameter attached to any portlet generated link even without using URL mapping with taking in consideration the size of the Dynamic cache.
You have to capture the parameter in the early portlet lifecycle phase which is called "doView" and by casting the RenderRequest to HttpServletRequest
then you will be able to retrieve them from getQueryString() method (you will not be able to capture them from getParameter method of RenderRequest even though the specification mentioned that) and after that you can dispatch to any page in your application.
The third way, if you try to generate a link to a portlet using URL Generation tags, you are allowed to add the parameter to that link and capture it in doView by the same way as below:
<wps:urlGeneration contentNode="MyApp.app" portletWindowState="Maximized" newWindow="True">
<wps:urlParam name="MyParam" value="Hi There"/>
<a href="<% wpsURL.write(out); %>" target="_blank" >My Link</a>
</wps:urlGeneration>
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
System.out.println("The parameter is: "+httpServletRequest.getQueryString());
super.doView(request, response);
}
Note: The complete code of your portlet lifecycle by default will be in a package com.ibm.{your project name}
and RSA will ask you if you want it to be available or not at the beginning of the project creation and if you did not make it available you still can create it by overriding your <portlet-class>
of your portlet in portlet.xml
.