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 is connection pooling?
What is servlet and its use?
What is cgi and what are its drawbacks?
What is the difference between encodeRedirectUrl and encodeURL?
How do you create a cookie using servlet?
What is a generic servlet?
Which method the Servlet container call to create the instance of the servlet?
16 Answers emc2, JK Technosoft,
How will you open a new page after certain interval of time (5 sec), on clicking of a button in an html page?
What is the purpose of requestdispatcher interface?
How to get the path of servlet in the server?
What is the type of method for sending request from http server?
What is load-on-startup in servlet?