19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NOTE: The URL query string uses the GET method <strong>to</strong> issue a<br />

request <strong>to</strong> the servlet. The current time may not be<br />

current if the Web page for displaying the current time<br />

is cached. To ensure that a new current time is<br />

displayed, refresh the page in the browser. In the next<br />

example, you will write a new servlet that uses the POST<br />

method <strong>to</strong> obtain the current time.<br />

42.6 HTML Forms<br />

HTML forms enable you <strong>to</strong> submit data <strong>to</strong> the Web server in a convenient<br />

form. As shown in Figure 42.16, the form can contain text fields, text<br />

area, check boxes, <strong>com</strong>bo boxes, lists, radio but<strong>to</strong>ns, and but<strong>to</strong>ns.<br />

Figure 42.16<br />

An HTML form may contain text fields, radio but<strong>to</strong>ns, <strong>com</strong>bo boxes,<br />

lists, check boxes, text areas, and but<strong>to</strong>ns.<br />

<br />

The HTML code for creating the form in Figure 42.16 is given in Listing<br />

42.3. (If you are unfamiliar with HTML, please see Supplement V.A, “HTML<br />

and XHTML Tu<strong>to</strong>rial.”)<br />

Listing 42.3 StudentRegistrationForm.html<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!