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 |
Can threads be used in Servelet?
How is a servlet implemented in code?
What is the difference between portlet and servlet?
can servlet have instance variables?
Which method is called when reference variable is passed in system.net?
What do you mean by session tracking?
Is tomcat a servlet container?
What is servlet configuration?
How does Cookies work in Servlets?
Which exception is thrown if servlet is not initialized properly?
What is httpservlet and how it is different from genericservlet?
What is DSN and System DSN and what is the difference between them?