Field Validation
This code is still lacking a bit. First, if the customer enters a duplicate e-mail address, the page does not provide any helpful feedback to let him know that it occurred. Second, because you're not validating the fields, someone could put total garbage into them and still create a new customer. Form-field validation is one of the major components of Web site design. You need to thoroughly understand what values are allowed in certain fields and how fields could be interdependent—in other words, Field 1 might be required only if Field 2 is filled in.
Validating fields is generally straight-forward. Returning error messages from validation is more complex and requires some decisions to be made. Basically, error conditions can ...
Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.