Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7687831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:47:25+00:00 2026-05-31T19:47:25+00:00

In HTTP servlets for Java I want to submit a form. What is the

  • 0

In HTTP servlets for Java I want to submit a form. What is the recommended way
of carrying the values from the input fields? Is it using hidden fields
and get them through request.getParameter(...) or with request.getAttribute(...)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:47:26+00:00Added an answer on May 31, 2026 at 7:47 pm

    All the form data will be sent as request parameters with the input field name as parameter name and the input field value as parameter value.

    E.g.

    <form action="servletURL" method="post">
        <input type="text" name="foo" />
        <input type="text" name="bar" />
        <input type="submit" />
    </form>
    

    With inside doPost() method:

    String foo = request.getParameter("foo");
    String bar = request.getParameter("bar");
    // ...
    

    You don’t need to use JavaScript to transfer them to other hidden fields or something nonsensicial, unless you want to pass additional data which the enduser don’t need to enter itself.

    The request attributes are to be used for the other way round; for passing the results from the servlet to the JSP file which should in turn present them along all the HTML.

    See also:

    • Our servlets wiki page – contains a Hello World
    • How do servlets work? Instantiation, sessions, shared variables and multithreading
    • doGet and doPost in Servlets
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way (in Java Servlet) to determine whether a HTTP POST or
What technologies are used / recommended for HTTP Rpc Calls from Silverlight. My Server
I written a program to retrieve data from database in servlets.now I want pass
I want to call a Servlet from a Java application. The problem is, that
I want to develop a java servlet able to authenticate via HTTP protocol on
I'm implementing a long poll http connection using java servlet. How can I know
My web.xml is like <web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd> <display-name>sample</display-name> <servlet> <servlet-name>Sampleclass</servlet-name> <servlet-class>sample.SampleClass</servlet-class>
I am using a javax.servlet.http.HttpServletRequest to implement a web application. I have no problem
Is it possible to derive the preferred language from a httpsession object (javax.servlet.http.HttpSession) ?
I have an applet that communicates with a servlet using Http (Not sockets). Currently,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.