Skip to Content
Java EE 8 Application Development
book

Java EE 8 Application Development

by David R. Heffelfinger
December 2017
Intermediate to advanced
372 pages
8h 46m
English
Packt Publishing
Content preview from Java EE 8 Application Development

Processing HTML forms

Servlets are rarely accessed by typing their URL directly into the browser. The most common use for servlets is to process data entered by users in an HTML form. In this section, we illustrate this process.

The HTML file containing the form for our application looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
        <title>Data Entry Page</title> 
    </head> 
    <body> 
        <form method="post" action="formhandlerservlet"> 
            <table cellpadding="0" cellspacing="0" border="0"> 
                <tr> 
                    <td>Please enter some text:</td> 
                    <td>                     <input type="text" name="enteredValue" />                    </td>
                </tr> 
                <tr> 
                    <td></td> 
 <td><input ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java EE 8 Development with Eclipse

Java EE 8 Development with Eclipse

Ram Kulkarni
Beginning EJB in Java EE 8: Building Applications with Enterprise JavaBeans

Beginning EJB in Java EE 8: Building Applications with Enterprise JavaBeans

Jonathan Wetherbee, Massimo Nardone, Chirag Rathod, Raghu Kodali

Publisher Resources

ISBN: 9781788293679Supplemental Content