Java Reference
In-Depth Information
Figure 10.7: The Login page
Besides being required fields, the username must exist, and the pass-
word must match. This logic is in a validation method because it in-
volves querying the user DAO. Notice that the code checks for the exis-
tence of the username first and then verifies the password. This way,
we can tell the user specifically which of the username or password is
incorrect after a failed login.
At this point, we have a fairly complete webmail application. We still
need to address security issues and could add some polish by grace-
fully handling any exceptions that might occur. We've been using mock
DAOs—we should eventually move on to using a real database. We'll
cover all those topics—and more—in Part III. Before getting to that, let's
see how we can make the application available in multiple languages.
 
 
 
Search WWH ::




Custom Search