This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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