How to deal with multi-valued parameters in a servlet?
Answers were Sorted based on User's Feedback
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 |
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 |
How the JSP file will be executed on the Server side?
What happens, if server sends a cookie to a browser that doesn't supports cookies?
How a servlet is unloaded?
What are sessions in servlets?
What is the difference between ExecuteUpdate and ExecuteQuery?
What is the difference between get and post methods?
Explain the lifecycle of a servlet?
can i modify the data which are generated by the servlet
What are the types of an http request?
What is session variable in servlets?
How do I know if java is running on linux?
What is the purpose of inter-servlet communication?