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

Can threads be used in Servelet?

3 Answers  


How is a servlet implemented in code?

0 Answers  


What is the difference between portlet and servlet?

0 Answers  


can servlet have instance variables?

8 Answers   Syscon, Wipro,


Which method is called when reference variable is passed in system.net?

0 Answers   HCL,






What do you mean by session tracking?

0 Answers  


Is tomcat a servlet container?

0 Answers  


What is servlet configuration?

0 Answers  


How does Cookies work in Servlets?

0 Answers  


Which exception is thrown if servlet is not initialized properly?

1 Answers  


What is httpservlet and how it is different from genericservlet?

0 Answers  


What is DSN and System DSN and what is the difference between them?

2 Answers  


Categories