Websphere Portlet 迁移,DispatchAction 中缺少参数
我正在将旧的 portlet 应用程序从 WPS5 迁移到 WPS6。 该应用程序正在使用 IBM 旧容器。 根据迁移指南,我只更新了一些门户库和一些标签引用。 该应用程序仍然使用 IBM 旧版容器和修改后的 Struts Portlet。
当我创建如下链接时:
<html:link page="/page1.do?method=display">Go to Page 1</html:link>
链接呈现这样的网址:
/wps/.../...[hash-like chars]_spf_strutsAction=!2fpage1.do!3fmethod%3ddisplay#[hash-like chars]
我正在使用 DispatchAction
,它将查找用于调度的参数“method”。 但是,点击上面的链接无法将'method'参数传递给dispatchAction。 对请求参数的进一步调查发现了这个键值对:
name: spf_strutsAction
value: !2fpage1.do!3fmethod=display
所以很明显 request.getParameter('method')
返回 null,因为该参数被隐藏在 request.getParameter(' spf_strutsAction')
因此无法调度该操作。
当然,我可以通过读取隐藏的参数来强制调度操作。 但问题是除了“method”之外还有很多其他参数。
我认为门户服务器应该提供其PortletRequest 的实现。 PortletRequest.getParameter() 是否有某种不正确的地方? 或者是Portlet Struts 问题? 如何将这些参数放回请求对象中?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一些想法:
Some ideas: