How to deal with multi-valued parameters in a servlet?
Answer Posted / tulasi vani
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 |
Post New Answer View All Answers
Difference between java beans & servlets?
What do you mean by cgi and what are its drawbacks?
Why are servlets used?
what do you understand by url rewriting?
What is servlet configuration?
How is an application exception handling is done using a servlet?
Who is responsible for writing a constructor?
What are the differences between the servletconfig interface and the servletcontext interface?
Describe servlet?
Which exception is thrown if the servlet is not initialized properly?
What is difference between jsp and servlet?
What are the types of servlets? Explain
What is servlet looping or chaining?
How do you run a servlet?
What is servlet api used for conneting database?