Home » servlet » getting all request parameters in servlet

getting all request parameters in servlet

before this we have used request.getParameter(String) which is used to get a single request parameter value.
Now if we want to get all parameter names then we have to use request.getParameterNames()
it returns Enumeration of String objects of all parameter names.
After getting all parameter names we can get its value using request.getParameter(String) .
request.getParameterNames() is useful we have large number of parameters are used in request.
Following example is used to explain the above concepts.

Project Explorer:
1309_project_explorer

index.jsp

AllSerlvet.java

pom.xml

Result:
1309_first

1309_seconf

Managed by MochaHost - Fast & Easy WordPress Hosting