使用 Jsr 168 在 jsf 门户中使用命令按钮传递 URL 参数
当我使用 JSR 168 中的 Jsf 中的命令按钮调用另一个 portlet 时,我无法从 URl 接收参数。 实际上,我是从生成 URL 的命令按钮中调用 manageBean 的方法,并调用另一个 Portlet。但我无法在被调用的 Portlet 的另一个管理Bean 中接收参数。
谁能告诉我哪里出错了。
I am not able to receive parameter from the URl when I am calling another portlet using Command Button in Jsf in JSR 168.
Actually I am calling the method of my manageBean from the Command Button where I am generating the URL, and calling another Portlet. But I am not able to receive the parameter in my another manageBean of the Called Portlet.
Can anyone please tell me where I go wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检索 JSR 168 Portlet URL 参数;您有以下三个选择之一(据我所知):
在 Websphere Application Server 级别创建过滤器并配置动态缓存来存储查询字符串,然后您将能够获取附加到任何 portlet 生成的链接的任何参数,甚至不使用 URL 映射并考虑动态缓存的大小。
您必须在早期的 portlet 生命周期阶段捕获称为“doView”的参数,并将 RenderRequest 转换为 HttpServletRequest
然后您将能够从 getQueryString() 方法检索它们(即使规范提到了,您也无法从 RenderRequest 的 getParameter 方法捕获它们),之后您可以分派到应用程序中的任何页面。
注意:默认情况下,Portlet 生命周期的完整代码将位于包
com.ibm.{您的项目名称}
中,RSA 将询问您是否希望它可用,网址为项目创建的开始阶段,如果您没有使其可用,您仍然可以通过覆盖portlet.xml
中 portlet 的
来创建它。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:
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 inportlet.xml
.