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

Explain the difference between servlet and cgi?

0 Answers  


List out difference between a JavaBean from a Servlet?

0 Answers  


HTTP tunneling means what?

2 Answers  


Explain servlet.

0 Answers  


What is servlet invoker?

0 Answers  






What are the steps that are required to handle the multi-threading?

0 Answers  


Explain url encoding?

0 Answers  


Is dispatcher servlet a singleton?

0 Answers  


What is the dispatcher servlet?

0 Answers  


When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?

0 Answers  


what do you understand by url rewriting?

0 Answers  


Can servlet have a constructor ?

0 Answers  


Categories