-2

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

Akhil Menon
  • 306
  • 1
  • 9
  • From your URL, where does it say `1001` is `customerId`? And you are extracting it from GET request with the name of `customerId`. You are using Django pattern, you could see [***this***](http://stackoverflow.com/questions/8715474/servlet-and-path-parameters-like-xyz-value-test-how-to-map-in-web-xml#answer-8715566) – Parkash Kumar Aug 17 '16 at 10:39

2 Answers2

3

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

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

thanks anyway

Akhil Menon
  • 306
  • 1
  • 9