Websphere Portlet 迁移,DispatchAction 中缺少参数

发布于 2024-07-13 06:23:18 字数 1001 浏览 7 评论 0原文

我正在将旧的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

記柔刀 2024-07-20 06:23:18

一些想法:

  1. 您可以使用 portlet 标签来生成链接。
  2. 查看 IBM Portal 6.0 附带的“较新”struts jar
  3. 考虑使用更好的 portlet Web 框架,例如符合 jsr168 的 Spring Portlet MVC。 IBM 将来不会支持其旧的 portlet 模型。

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文