Liferay - Can't get value from the URL on jsp

334 views Asked by At

I'm having issue in fetching the value from the url eg:xyz.com/customer/1001. Here 1001 is the customer Id and I'm using the following command to get the value on the jsp :

long customerId = Long.valueOf(ParamUtil.getString(request,"customerId"));

Using the above code it gives me null as the value of customerId even though it is present in the url.

Thanks in advance

2

There are 2 answers

0
Kaloyan Spiridonov On

ParamUtil.getString method have two arguments getString(javax.servlet.http.HttpServletRequest request, String param) as you can see the second argument is "param". To get value of this parameter, the url have to contains this parameter so you can try to access this url xyz.com/customer?customerId=1001

0
Akhil Menon On

The problem was related to the old projects in tomcat webapps, when I deleted it now it's working.

thanks anyway