Saturday, 1 September 2012

How do I find whether a parameter exists in the request object?


• The following code implies it

boolean hasFo = !(request.getParameter("fo") == null

|| request.getParameter("fo").equals("")); 


Or

boolean hasParameter =

request.getParameterMap().contains(theParameter);

No comments:

Post a Comment