How to deal with multi-valued parameters in a servlet?
Answers were Sorted based on User's Feedback
Answer / janet
Use the getParameterValues() method. This returns a String
array(or null) containing all the values of the parameter
requested.
| Is This Answer Correct ? | 2 Yes | 0 No |
To get the multi-valued parameters in servlet we can use
getParameterValues().
request.getParameterValues() which returns an array of
values which are associated with it.
Use an Enumeration to store the values.It has two methods
namely hasMoreElements()which is used in a while loop
which executes unitl it finds another element in the
enumeration and hasNext()which is again used in a while
loop and executes until it has a nextElement and retrives
the required data.
| Is This Answer Correct ? | 1 Yes | 0 No |
Who is responsible to create the object of servlet?
What is cgi?
What are the exceptions thrown by servlets? Why?
What are the features added in Servlet 2.5?
program for RequestDispatcher in servlets?
Can you create a deadlock condition on a servlet?
What are the different types of servlets?
Define the lifecycle for executing a jsp page.
how can we create object to a class in a jsp file?
5 Answers Accenture, L&T, TCS,
why are extending GenericServlet and why are extending HttpServlet explain?
What is done after deploying a war file and before client gives a request
How many ways are available to ger RequestDispatcher object?