File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Extracting Query String from URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Extracting Query String from URL" Watch "Extracting Query String from URL" New topic

Extracting Query String from URL

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 224
Q1) My request URL is url: http://localhost:8080/Json/register?action:getReservations. On server side i want to extract string getReservations which is my name of my method in a servlet.To acheive i am writing servlet code

it return me as

How can i get only getReservations String ?
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

Please use the Servlet API, HttpServletRequest.getParameterValues.

Not many get the right opportunity !
I agree. Here's the link:
subject: Extracting Query String from URL
It's not a secret anymore!