Java Servlets Programming
|Duration: 3 days|
|Participants: This course is intended for programmers who are familiar with Java and who want to begin coding Java server side programming.|
Upon successful completion of this course you will be able to:
- Write servlets and JSPs that receive and send data to web pages.
- Write servlets that process an html form submitted by a web user.
- Access and update relational databases using Java servlets and JDBC.
- Use industry-tested design patterns to write multi-user Java servlets.
- Write servlets that use session variables and cookies to store user information to create "conversation-like" applications.
- Handle exceptions in your servlets code.
- Write modular servlets and transfer control between Java classes.
- Use JavaBeans to manage and transfer user data between application components.
- Learn the basics of servlets that apply to JSPs, which you will learn in the next course.
|Overview: This intensive hands-on course teaches developers to create Server-side Java programs using servlets. The foundations of this course are needed for follow-up courses such as JSPs, JSFs, and Struts. Extensive hands-on workshops will use either TextPad or Eclipse as the IDE, as well as Apache Tomcat and an RDBMS, such as MS Access or IBM DB2 for the relational database.|
|Prerequisites: Experience developing Java programs, a basic understanding of JDBC, and ability to code basic HTML.|
Future Courses for Additional Advanced Topics:
- JSPs (Java ServerPages)
- JSFs (Java Server Faces)
- OO and UML
|Format: Lecture and discussion with hands-on exercises.|
- Process Users' Form Submissions
Your HTML forms can be submitted to a Java servlet on your server, which in turn will query databases, write data to files, and generate email messages based on the submitted information. Learn how to write servlets that process data submitted via the GET and POST methods, as well as data provided by hyperlinks, cookies, and session variables.
- Session Variables and Cookies
- Handle Exceptions and Errors in Your Code
- Build Applications that Read From and Write To Files Using Classes in the java.io Package
- Use Regular Expressions to Validate Users' Form Submissions
- Build Basic JavaBeans
- Introduction and Overview
Web application development
Requirements of a Web application
Components of an n-tier architecture
Key components of J2EE for Web development
- Generating Content with Servlets
Getting started with servlets
Integrating servlets into the Web application architecture
Deploying servlets on various Web servers
Avoiding common servlet pitfalls
Utilizing the Java Servlet API
Servlet life cycle methods
Accessing servlet environment variables
Creating Web-based forms for user input
Adding text fields and drop-down lists
Linking forms to servlets
Retrieving form data in the servlet
- Accessing Enterprise Services with Servlets
Extending servlets with Java Database Connectivity (JDBC)
Connecting to the database
Submitting SQL statements
Retrieving and processing data
Formatting database results
Constructing an HTML table
Adding drill-down features
- Maintaining State in Java Web Applications
Reading and writing cookies to personalize Web content
Constructing cookies using the Java Servlet API
Retrieving cookies from a client request
Sending cookies to the client
Circumventing cookie limitations
Managing application state with sessions
Creating a unique session for each user
Storing and retrieving Java objects within sessions
Implementing a shopping cart
Controlling a session's life span
- Building Reusable JavaBeans Components
The component dream
Review of JavaBeans