Newsletter

How to Retrieve Client Input Data in Servlet

Servlets » on Jan 14, 2013 { 5 Comments } By Sivateja

When client send some input data to the servlet, that data will be available in the form of request object.  We can retrieve that input data through HttpServletRequest or ServletRequest interfaces.  There are 4 approaches to retrieve the client data which is present in request object.

  • public String getParameter(“input variable”);
  • public Enumeration getParameterNames();
  • public Map getParameterMap();
  • public String[] getParamterValues(“input variable contains muliple values”);

All these methods are present in javax.servlet.ServletRequest interface, and HttpServletRequest is the sub interface of ServletRequest, ok let us see how to use these methods with an example 🙂

 

 

​​

You Might Also Like

  ::. About the Author .::

Java4s_Author
- Java/J2EE Full Stack 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.

Comments

5 Responses to “How to Retrieve Client Input Data in Servlet”
  1. rahul says:

    Its really marvelous explanation. I have not yet come across any other website which explains in such a friendly way. No words , just i could say WOWWWWWW

  2. Shravan says:

    Really nice explanation and very good website for beginners. Could you please add JSP topics to this website.

  3. sheeeb says:

    Can you please explain more..

  4. rachna says:

    u gave vry good explaination but with every explanation give example also which can be better unstandable for every one and easily can use.

  5. ilavarasan.s says:

    please update "JAVA SERVER PAGES-JSP" CONCEPTS ,you are doing great ,no one is like u..pls update jsp

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Spring Boot Hibernate Spring
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.