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 Servlet API used for connecting database?
When a servlet accepts a call from a client, it receives two objects. What are they?
What are the features added in Servlet 2.5?
How to debug a servlet?
Is it possible to have a constructor inside the servlet?
Write a program to show the functionality of servlets.
if u havea .class file ,how can u say whether it is servlet or not ,dont use java decompliler
When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?
What exception should be thrown when servlet is not properly initialized?
List the Different types of servlet?
In servlets, Why do we need both GET and POST method implementations?
i need connection pooling code.....from harpreet.your@gmail.com