Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checking for parameters in URL

 
Anthony Leroy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic