Question: Rewrite Exercise 37.8 using servlets. Data from Exercise 37.8 Write a servlet that enables the user to change the password from an HTML form, as

Rewrite Exercise 37.8 using servlets.


Data from Exercise 37.8

Write a servlet that enables the user to change the password from an HTML form, as shown in Figure 37.30a. Suppose the user information is stored in a database table named Account with three columns: username, password, and name, where name is the real name of the user. The servlet performs the following tasks:

a. Verify that the username and old password are in the table. If not, report the error and redisplay the HTML form.

b. Verify that the new password and the confirmed password are the same. If not, report this error and redisplay the HTML form.

c. If the user information is entered correctly, update the password and report the status of the update to the user, as shown in Figure 37.30b.

oPvo H wwoy s T loooe esohtlert Cheg Paswond Uume jwern M

oPvo H wwoy s T loooe esohtlert Cheg Paswond Uume jwern M do Old Peswoed see New Pemed l Cotfim New Paismoet fe Hello, Joln F. Smith, your passmted has been updatett (2) (b)

Step by Step Solution

3.44 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javaioIOException import javasqlConnection import javasqlPreparedStatement import javasqlResultSet import javaxservletServletException import j... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Java Programming and Data Structure Questions!