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

checking for parameters in URL

Anthony Leroy

Joined: Aug 02, 2001
Posts: 20
is it possible to check to see if there are any parameters in the URL? For example, if "myJsp.jsp" is called, (no parameters) I want one thing to happen and if "myJsp.jsp?param=blah" is called I want another thing to happen.

Joined: Apr 21, 2001
Posts: 11
HttpServletRequest.getParameterNames() returns the enumerated names of all prameters obtained thru the user requests. You can use this method and if it returns null then you can perform some other function. Does it help you??

Software Engineer,<BR>Cybage Software Pvt. Ltd,<BR>Pune
I agree. Here's the link:
subject: checking for parameters in URL
It's not a secret anymore!