Request parameter. How to find whether a parameter exists in the request object?

Alex Chaffee

boolean hasFoo = !(request.getParameter("foo") == null || request.getParameter("foo").equals(""));
Tom Paris adds:
boolean hasParameter = request.getParameterMap().contains(theParameter);
(which works in Servlet 2.3+)
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact