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 are sessions in servlets?

568


How is a servlet implemented in code?

561


How to generate the server side programming and the advantages of it over the other languages?

554


Which is the methods of generated servlet?

673


What is the web server used for running the Servlets?

573






What is url encoding and url decoding

578


What is the GenericServlet class?

594


What is servlet container?

660


What are some advantages of storing session state in cookies?

588


When servlet object is created?

594


Which httpsession object is used to view and manipulate information about a session?

725


What do you mean by request dispatcher in servlet? Also explain its methods.

606


How to get the actual path of servlet in server?

726


What is servlet api used for conneting database?

692


What do you mean by chaining in servlet?

566