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 the difference between?when we write the code in following manner? class One extends httpservlet { } and class One extends genericservlet { }
How to get the server information in a servlet?
what is a session object?
what are the CGI Programs?
What do you mean by request dispatcher in servlet? Also explain its methods.
What is Server-Side Includes?
if u havea .class file ,how can u say whether it is servlet or not ,dont use java decompliler
Why is a constructor needed in a servlet even if we use the init method?
How can we refresh automatically when new data has entered the database?
Why is servlet used?
What is servletconfig?
How will you pass values from HTML page to the servlet?