How to get parameters from the URL?

How to get parameters from the URL?
5/11/08 8:47 PM
Hi all,

Seems like a very simple thing to do, but I've been at it for a while now and just can't seem to get it to work! Here's my situation:

I have created a new page and assigned a friendlyURL to it. On that page, I've placed several custom portlets (Struts-based) - all of this is taking place in it ext environment. All I would like to do is to be able to provide a parameter in the URL and retrieve that parameter in any of the portlets - how do I go about doing this?

I've tried the obvious request.getParameter/request.getAttribute as well as various methods in the ParamUtil class, but it just doesn't seem to work. I must be missing something obvious here - any advice would be greatly appreciated! emoticon

Thanks!

RE: How to get parameters from the URL?
5/12/08 2:56 AM as 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.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值