views:

483

answers:

1

I'm migrating an old portlet application from WPS5 to WPS6. The application is using IBM legacy container. According to the migration guide, I only renew some portal library and some tag reference. The application is still using IBM legacy container and the modified Struts Portlet.

When I create a link like by:

<html:link page="/page1.do?method=display">Go to Page 1</html:link>

The link render such url:

/wps/.../...[hash-like chars]_spf_strutsAction=!2fpage1.do!3fmethod%3ddisplay#[hash-like chars]

I'm using DispatchAction, which would look up parameter 'method' for dispatch. However, click on the above link cannot pass the 'method' parameter to dispatchAction. Further investigation on the request parameter found out this key-value pair:

name: spf_strutsAction
value: !2fpage1.do!3fmethod=display

So it's quite obviously that request.getParameter('method') returns null because the parameter is buried under request.getParameter('spf_strutsAction') and thus the action cannot be dispatched.

Of course I can force the dispatch action by reading the buried parameter. But the problem is that there are many other parameter other than 'method'.

I think that the portal server should provides its implementation of PortletRequest. Is that the PortletRequest.getParameter() is somehow incorrect? Or is it the Portlet Struts Problem? How can I put those parameters back inside the request object?

A: 

Some ideas:

  1. You could use the portlet tags to generate the links.
  2. Check out the "newer" struts jars that come with IBM Portal 6.0
  3. Consider using a better portlet web framework, such as Spring Portlet MVC, which is jsr168 compliant. IBM will not be supporting it's old portlet model in the future.
Mercer Traieste