A Simple HTML Form

Up to this point, you have only learned how to send output back to the browser. One of the key points of the Web is the fact that you can create forms to send data from the browser to the server. You are ready to begin creating forms with JSP and servlets, and that's where the fun really begins!

To begin exploring HTML forms, it's best to start with a small form and expand from there. Also, it's better to start with a Java Server Page rather than a servlet, because it is easier to write out the HTML. Most of the form handling for JSP and servlets is identical, so after you know how to retrieve form information from a JSP, you know how to do it from a serv let as well. Listing 15.1 shows an HTML file containing a simple input ...

Get Special Edition Using Java™ 2 Enterprise Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.