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 |
How multiple simultaneous requests can be handled by servlets?
What is a servlet-to-servlet communcation?
What are the servlet events?
What is cookie in servlet?
Which event is fired at the time of setting, getting or removing attribute from application scope?
What is the use of RequestDispatcher in servlet?
18 Answers Accenture, CTS, TCS,
In which cases Destroy() is invoked?
What is a cookie What is the difference between session and cookie
What is the ServletConfig() and what is its use?
Which interface must be implemented by all servlets?
How do you configure a centralized error handler in servlets?
which method in doGet or doPost is use to send binary date to server