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 |
What do you mean by scope object and what are its types?
How to handle exceptions thrown by application with another servlet?
What do you mean by session tracking?
What are the classes and interfaces for servlets?
What are the difference between session and cookies in servlet? Explain
How we can check in particular page the session will be alive or not
Difference between GET and POST?
can i call init() method in destroy() method of servlset. ?
What is new in ServletRequest interface ? (Servlet 2.4)
i am bca student,give me suggest for bright future
18 Answers BSNL, Future Considerations,
What are the different mode that servlets can be used?
Can we override servlet service method?