19.09.2015 Views

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

(a)<br />

(b)<br />

Figure 42.33<br />

The user enters the username and the old password and sets a new<br />

password. The servlet reports the status of the update <strong>to</strong> the<br />

user.<br />

42.9**<br />

(Display database tables) Write an HTML form that prompts the user <strong>to</strong><br />

enter or select a JDBC driver, database URL, username, password, and<br />

table name, as shown in Figure 42.34a. Clicking the Submit but<strong>to</strong>n<br />

displays the table content, as shown in Figure 42.34b.<br />

(a)<br />

(b)<br />

Figure 42.34<br />

The user enters database information and specifies a table <strong>to</strong><br />

display its content.<br />

Section 42.8<br />

42.10*<br />

(S<strong>to</strong>re cookies) Write a servlet that s<strong>to</strong>res the following cookies in<br />

a browser, and set their max age for two days.<br />

Cookie 1: name is “color” and value is red.<br />

Cookie 2: name is “radius” and value is 5.5.<br />

56

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

Saved successfully!

Ooh no, something went wrong!