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

Differentiate between get and post?

906


Explain load on start-up and its importance?

859


Is servlet a framework?

780


What do you mean by scope object and what are its types?

808


What’s the difference between sendredirect and forward methods

845


What is the use of welcome-file-list?

787


What is servlet container?

888


What do you mean by web applications?

865


What is servlet and its types?

796


What are the types of Session Tracking ?

869


What are the different methods involved in the process of session management in servlets?

929


Differentiate between the get and post method

819


What is the requirement of servlet config and servlet context implemented and how are they implemented?

776


How can we refresh automatically when new data has entered the database?

861


What is a servlet-to-servlet communcation?

887