Get all updates of Java4s
Follow Us: Email Newsletter

How to Retrieve Client Input Data in Servlet

Servlets » On Jan 14, 2013 { 4 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 Author ♦

Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.


4 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.


By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

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