How to get parameters from the URL?
来源:互联网 发布:java微服务 模块化开发 编辑:程序博客网 时间:2024/05/01 02:28
How to get parameters from the URL?
5/11/08 8:47 PM
5/11/08 8:47 PM
Hi all,
Seemslike a very simple thing to do, but I've been at it for a while now andjust can't seem to get it to work! Here's my situation:
I havecreated a new page and assigned a friendlyURL to it. On that page, I'veplaced several custom portlets (Struts-based) - all of this is takingplace in it ext environment. All I would like to do is to be able toprovide a parameter in the URL and retrieve that parameter in any ofthe portlets - how do I go about doing this?
I've tried theobvious request.getParameter/request.getAttribute as well as variousmethods in the ParamUtil class, but it just doesn't seem to work. Imust be missing something obvious here - any advice would be greatlyappreciated!
Thanks!
Seemslike a very simple thing to do, but I've been at it for a while now andjust can't seem to get it to work! Here's my situation:
I havecreated a new page and assigned a friendlyURL to it. On that page, I'veplaced several custom portlets (Struts-based) - all of this is takingplace in it ext environment. All I would like to do is to be able toprovide a parameter in the URL and retrieve that parameter in any ofthe portlets - how do I go about doing this?
I've tried theobvious request.getParameter/request.getAttribute as well as variousmethods in the ParamUtil class, but it just doesn't seem to work. Imust be missing something obvious here - any advice would be greatlyappreciated!
Thanks!
- Top
Carlo CavallieriPosts: 20
Join Date: 3/7/08
Recent Posts
Join Date: 3/7/08
Recent Posts
RE: How to get parameters from the URL?
5/12/08 2:56 AMas a reply to Phil Mironenko.
5/12/08 2:56 AMas a reply to Phil Mironenko.
Hi Phil,
i've had the same problems and i've used the following code:
import com.liferay.portal.util.PortalUtil;
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(req));
String myArticleId = httpReq.getParameter("articleId");
Note that this is a sort of hack that i've found, not an official solution.
i've had the same problems and i've used the following code:
import com.liferay.portal.util.PortalUtil;
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(req));
String myArticleId = httpReq.getParameter("articleId");
Note that this is a sort of hack that i've found, not an official solution.
- How to get parameters from the URL?
- Get parameters from Url
- Java How to get the PID from a process?
- PHP: How to Get the Current Page URL
- Get URL from the text
- How to Drill Down to External url page. How to Pass url parameters
- How to Get the WDK
- [JavaScript]How to parse the URL and get the different fragments easily?
- How to get file from classpath
- How to get IHTMLDocument2 from a HWND
- How to get bean from tag component
- How to get byte array from imageview
- How to get UITableView from UITableViewCell?
- How to get UITableView from UITableViewCell?
- How to get kernel messages from Android?
- How to get source code from APK
- 怎样使用java读取网页源码 How To Get URL Content In Java | Reading Directly from a URL
- How to get the DOM of a WebBrowser control from a window handle (VB6)
- 关于问我Speech SDK问题的一些说明
- IE6及以上版本上的随屏幕移动而移动的代码
- 我
- 获取客户端操作系统类型
- Self-Regulation
- How to get parameters from the URL?
- 第一周
- Axure RP Pro - Prototype原型 - 关闭Internet Explorer打开原型时出现的安全警告
- POJ3414 Pots
- java 中压缩和解压文件的方法
- masm开发中@@.@F,@B
- Just get started!
- 怎样取得DBGridEh的footer中的字段合计值
- 企业信息系统的快速建模与开发——课程介绍