Target Audience
This course is targeted at the developer, already familiar with Java, looking to gain an in-depth knowledge of Server-side Java Programming. During the course the student will write many Servlets, JavaBeans and JavaServer Pages that interact with HTTP clients and databases.
Pre-requisites
The student should be familiar with Java Programming. They should have a good understanding of the basic Java language and the more commonly used Java API classes. This knowledge can be gained by attending courses EC21 and EC22.
Course Objectives
This course provides students with the skills to write effective Servlets, JavaServer Pages and JavaBeans.
While covering these in detail, the course retains a ‘high level’ overview of the Design Patterns used for such development.
During the course the student will write many of these to ensure that the statements taught are fully understood and practical experience is gained.
On completion of this course the student will be able to:
-
understand and use Java Database Connectivity
-
use the JDBC API
-
code JDBC dynamic and prepared statements
-
process JDBC results sets
-
process JDBC NULL values
-
handle JDBC errors and warnings
-
understand and use transaction control
-
understand and use Isolation Levels
-
use JDBC connection pooling techniques
-
code servlets
-
process HTTP requests and responses
-
process GET and POST requests
-
process HTML forms
-
understand servlet multi-threading issues / pitfalls
-
adopt single threading techniques where appropriate
-
use standard server error codes
-
understand servlet chaining
-
use the Session Tracking API
-
understand hidden fields / URL rewriting techniques
-
set and read cookies
-
use the request dispatcher
-
write JavaBeans
-
code JavaServer Pages
-
access JavaBeans from servlets / JSPs
-
use JSP tags
-
understand JSP JavaBean scopes
-
use JSP forwarding
-
use Model, View, Controller methodologies
-
use JSP error pages
-
use the WebSphere / RAD testing environment (if applicable)
Course Environment
Development will be performed using:
-
the Java Development Kit (JDK) plus a text editor
-
JBuilder
-
NetBeans
-
Websphere Studio Application Developer
-
Rational Application Developer
-
Eclipse
Course Details
- INTRODUCTION TO SERVER-SIDE PROGRAMMING
- Overview of Server side programming
- Servlets, Java Server Pages, Web Servers, Java Beans
- Model, View, Controller architecture
- DATABASE ACCESS
- What is JDBC?
- What alternatives are there? JDBC vs SQLJ
- How does JDBC work?
- JDBC Drivers and the JDBC API, Statements & Prepared Statements
- Working with data
- Accessing data - Working with Result Sets
- Handling Warnings, Errors and NULL Values
- Scalability Issues
- Transaction Control and Isolation Levels
- Configuring and using DataSources (using JNDI)
- SQLJ
- SQLJ Programming - Development Cycle using DB2
- SQLJ Cursor Techniques
- SERVLETS
- Servlet Overview
- Servlet vs CGI Advantages
- The Java Servlet API
- Servlet Life Cycle
- Multi-threading issues / pitfalls
- What Servlets Are
- Non-Http Servlets - Implementing the Servlet Interface
- Non-Http Servlets - Extending the GenericServlet class
- Http Servlets - Extending the HttpServlet class
- What Servlets do
- HTML Get and Post Requests & Catering for both
- Getting data to Servlets - the HttpRequest Object
- Sending HTML back to the client - the HttpResponse Object
- Using the Data sent to a Servlet
- Form Validation
- Data Validation
- Servlet Security
- Restricting Servlet Access
- Error Handling
- Server Error Codes
- Server Side Includes
- Extra HTML tags
- Servlets can invoke other servlets
- Dispatching a Resource from within a Servlet
- USING WSAD TO CODE SERVLETS (if applicable)
- The J2EE Heirarchy
- Web Projects, Where Servlets should go
- Creating Servlets
- Testing Web Applications
- Server Perspective, Servers, Server Configurations and Instances
- Debugging Servlets
- USING RAD 6.0 TO CODE SERVLETS (if applicable)
- The J2EE Heirarchy
- Web Projects, Where Servlets should go
- Creating Servlets
- Testing Web Applications
- Server Perspective, Servers, Server Configurations and Instances
- Debugging Servlets
- ACCESSING DATABASES VIA SERVLETS
- Servlets, JDBC and Connection Pooling
- DataSource Definitions and Getting Database Connections via a DataSource
- DATA SCOPE / PERSISTENCE
- Variable Scope & Protection
- Instance variables are shared!
- Thread Safety - Synchronized Code
- What is Request Scope?
- Storing Objects for the lifetime of the Request
- What is Session Scope?
- Storing Objects for the lifetime of the Session
- Session Tracking using Cookies, URL Rewriting, HiddenFields
- Session Tracking API
- Session Creation and Lookup, Storing and Retrieving Session API Information, Lifecycle, session tracking without Cookie support
- Session Binding
- What is Application Scope?
- Sharing Data between different Servlets
- JAVASERVER PAGES
- JSP Overview
- The Problem with Servlets - Why use JSPs?
- How JSP Pages Are Executed
- Writing a JavaServer Page
- JSP Tags, Directive Tags, Scripting Tags & Scriptlets, Action Tags
- JSP Pre-Defined Objects
- Including Static and Dynamic Content
- Forwarding execution to Servlets, JSP’s or HTML pages.
- JSP Initialisation and Cleanup
- USING WSAD FOR JSP DEVELOPMENT (if applicable)
- Overview
- HTML Page Designer, Creating and editing HTML files
- Testing JSPs
- Testing and Debugging JSPs
- USING RAD 6.0 FOR JSP DEVELOPMENT (if applicable)
- Overview
- HTML Page Designer, Creating and editing HTML files
- Testing JSPs
- Testing and Debugging JSPs
- JSP DESIGN PATTERNS
- MVC Architecture
- Where are JSPs used?
- JSP Design Patterns
- Stand alone JSPs, JSPs calling Servlets, JSPs accessing JavaBeans
- Getting data from HTML Forms to JSPs
- Handling HTML Forms
- JavaBeans
- Using JavaBeans
- Form / Bean / JSP Interaction
- Accessing JavaBeans from JSPs - JavaBean Tags
- Getting Data from the Bean to the JSP Page
- Variable and JavaBean Scopes
- JSP Variable Scopes
- JavaBean Scopes
- Moving around!
- Invoking a JSP from a Servlet
- Passing Objects from Servlet to JSP
- Passing JavaBeans from Servlet to JSP
- Error Handling
- The JSP Error Page
- Full Shopping Cart Example
- CUSTOM TAG OVERVIEW
- Why use Custom Tags?
- How are Custom Tags implemented?
- Custom Tag Elements, the Tag Library Descriptor (TLD)
- The Tag Handler Class, using JavaBeans to Implement Tags
Course Format
Practical sessions make up a large part of the course, allowing delegates to demonstrate and reinforce the lectures given.
Examples are used extensively, ranging from simple code 'snippets' to full applications with complete ‘real world’ functionality. These are supplied at the start of the course and it is encouraged that the delegates execute and ‘experiment’ with these under the instructor’s guidance as they are introduced.
These examples are available to take away, along with the delegate’s own work.
The comprehensive Student Guide supplied is fully indexed serving as a useful reference tool long after the course has finished. Delegates will also be able to access a free help-line with technical questions relating to topics covered on the course.
|