How to deal with multi-valued parameters in a servlet?

Answer Posted / tulasi vani

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by servlet? What are the parameters of the service method?

795


What is servlet in simple terms?

786


Explain mvc pattern.

769


How can you run a servlet program?

799


What are the kinds of http requests?

796


Why is httpservlet declared abstract?

796


How can you start a jta transaction from a servlet deployed on jboss?

872


What are the different types of servlets?

746


How to get the IP address of client in servlet?

832


What is the purpose of requestdispatcher interface?

823


How do you run a servlet?

778


Whether we can get deadlock situation in servlets?

808


What is the difference between genericservlet and httpservlet

775


How can we upload the file to the server using servlet?

752


What are the type of protocols used in httpservlet?

796