File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "checking for parameters in URL" Watch "checking for parameters in URL" New topic
Author

checking for parameters in URL

Anthony Leroy
Greenhorn

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.
thanks,
Ant
Praveen
Greenhorn

Joined: Apr 21, 2001
Posts: 11
Hi,
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??
thanks

Software Engineer,<BR>Cybage Software Pvt. Ltd,<BR>Pune
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: checking for parameters in URL