InfoCenter Home > 4.2.4.4.1.2: Invoking servlets and JSP files within HTML formsA Web page can be designed so that users can invoke a servlet or JSP file from an HTML form. An HTML form enables a user to enter data on a Web page (from a browser) and submit the data to a servlet, or a servlet generated by a JSP file. The HTML FORM tag has attributes for specifying how to invoke the servlet or JSP file:
If the information entered by the user is to be submitted to a servlet by a GET or POST method, the servlet must override the doGet() method or doPost() method. For JSP files, the override is not necessary. The same service method that is called whether the form is submitted using GET or POST. ExamplesUsing GET: <FORM METHOD="GET" ACTION="/application_Web path/servlet_Web_path"> <!-- HTML tags for text entry areas, buttons, and other prompts go here --> </FORM> Using POST: <FORM METHOD="POST" ACTION="application_Web_path/servlet_Web_path"> <!-- HTML tags for text entry areas, buttons, and other prompts go here --> </FORM>
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|