Get all updates of Java4s

Example on getParameterNames() method of Servlet Request Object

Servlets »on Jan 19, 2013 { 4 Comments } By Sivateja

So far we have worked on getParameter(), let us see how to use getParameterNames() method. With getParameter() we are able to find parameter values by passing parameter name, just like..

In html:
<input type=”text” name=”n1″>

In Java:
String val=req.getParameter(“n1″);

Parameter name – n1
Parameter value – val

If a client send the data to the servlet, that data will be available in the object of HttpServletRequest interface. In case of getParameter() method we have to pass input parameter name and it will give the value. If you are not aware of input parameter name ? or if you have 50+ input values its really tedious to use getParameter() method.

That’s why this getParameterNames() came into picture :-)

Directory Structure

Files Required

  • index.html
  • web.xml





You Might Also Like

  ::. About the Author .::

- Full Stack Java/J2EE & UI Web Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can sign-up for the Email Newsletter for your daily dose of Java tutorials.


4 Responses to “Example on getParameterNames() method of Servlet Request Object”
  1. Debendra says:

    what is the use of tag in web.xml ?

  2. Rajveer says:

    sir how can we print entire page throgh servlet

  3. dev says:

    Dear sir,

    I want to develop one project related to digital signature verification ,I do’t know how it works
    please sir help me I want to solve this problem early as possible.

    Dev Mishra

  4. Nilesh Pawar says:

    Its so simple to understand


By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Spring-Boot-tutorials Hibernate tutorials Spring tutorials Struts tutorials Servlets tutorials Ajax tutorials Log4j tutorials jQuery tutorials Json tutorials Core Java tutorials Web Services tutorials AngularJs tutorials
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2018 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.