Java Servlet Programming Question:

Download Job Interview Questions and Answers PDF

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

Java Servlet Programming Interview Question
Java Servlet Programming Interview Question

Answer:

1.boolean hasFoo = !(request.getParameter("foo") == null || request.getParameter("foo").equals(""));
2. boolean hasParameter = request.getParameterMap().contains(theParameter);
(which works in Servlet 2.3+)

Download Java Servlet Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What is new in ServletRequest interface?(Servlet 2.4)How can I send user authentication information while makingURLConnection?