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

Which are the different ways you can communicate between servlets?

0 Answers  


What are setComment and getComment methods in Cookies?

2 Answers  


How can the session in servlet be destroyed?

0 Answers  


What is the importance of init() method in Servlet ?

0 Answers   BirlaSoft,


What is the difference between sendredirect() and forward() in a servlet?

0 Answers  






Write a program to show the functionality of doget and dopost method?

0 Answers  


can we create more than ServletContext and ServletConfig in your application

6 Answers   Patni,


What is the use of servlet wrapper classes?

0 Answers  


What are session variable in servlets?

0 Answers  


Difference between web container & web server........... Difference between web server & application server?????????

8 Answers   TCS,


How values can be passed from HTML page to servlet?

7 Answers   ABC,


What are the life cycle methods of a servlet?

0 Answers  


Categories