action=” URL of the servlet”: specifies relative URL of the servlet which is responsible for handling data posted from this form.įor example, following is HTML code of a login form:.Generally, form submission should be done in HTTP POST method. method=”post”: to send the form data as an HTTP POST request to the server.To make the form works with Java servlet, we need to specify the following attributes for the tag: , , …: to create form fields like text boxes, dropdown list, text area, check boxes, radio buttons,… and submit button.: to create a form to add fields in its body.The following picture depicts that workflow with Java servlet on the server side: To create a form in HTML we need to use the following tags: The server will process the request based on the submitted data, and send response back to the client. A typical scenario is the user fills in fields of a form and submits it. In this Java servlet tutorial, I will guide you how to read values of common input fields from HTML form on the server side with Java Servlet.You know, handling form data represented in HTML page is a very common task in web development.