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

Answers were Sorted based on User's Feedback



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

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

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

Answer / 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

More Servlets Interview Questions

What is use of parseQueryString?

1 Answers  


What is cookie in servlet?

0 Answers  


Explain the features are in servlet 3?

0 Answers  


What's the difference between servlets and applets?

0 Answers  


What is the web server used for running the Servlets?

0 Answers  


What is the life-cycle of servlets?

0 Answers  


Difference between jakarta tomcat and apache Tomcat?

4 Answers   IBM,


What do you mean by interservlet communication?

0 Answers  


Is servlet a controller?

0 Answers  


Why is a constructor needed in a servlet even if we use the init method?

0 Answers  


Describe servlet?

0 Answers  


What do you mean by web applications?

0 Answers  


Categories