Servlet & JSP Programming using WebSphere Studio Application Developer (WSAD)
Duration
Five days
Description
This workshop will teach students a variety of java and Servlet programming skills in a WSAD environment. The class begins with exploring WSAD and how it works with Java. The students then learn to use Servlets and JDBC. The course also covers JSP syntax, deployment and application models with some exploration of Java as a scripting language. The students will learn about the capabilities and architecture of Servlets. They will discuss the advantages of Servlets over CGI and how to deal with exception handling and session management.
Audience
This course is designed for programmers.
Pre-requisites
The student should have a working knowledge of Java programming and some experience with HTML.
Topics
- Using WSAD
- Servlets
- Java Server Pages
- JavaBeans
- JDBC
- Servlets and JSP Interaction
- Architecting Web Applications
Course Outline
I. Using WSAD
- The WorkBench
- Web Project
- Tools for Web Development
- Web Perspective
- Navigator View
- Java Code Editor
- Page Designer
- Design View
- Source View
- Additional Views
A. Organizing the Workbench
- Rearranging views and Editors
- Displaying Views
- Changing Default Text
- Specifying the Default Perspective
B. Debug Perspective
- How to Debug Java Code
- Breakpoints
- Debug Functions
II. Servlets
- What is a Servlet ?
- Typical Uses of Servlets
- Advantages Over CGI
- How Servlets Work
- Servlet’s Lifecycle
- Java Servlet Architecture
- service() method
- Writing HelloServlet
- Creating Servlets in WSAD
- Testing the HelloWorld servlet
- Debugging HelloWorld servlet
- The ServletRequest Object
- Handling Form Data
- doGet() vs doPost()
- Using doGet()
- Using doPost()
- The ServletResponse Object
- The ServletContext Object
- Session Management
A. JavaServer Pages
- Why Use JSP ?
- How JSPs Work
III. JSPs Life
- Simple JSP
- Creating JSPs in WSAD
- Running JSPs in WSAD
- Using Icons
- Scripting Elements
- Scriptlets
- Expression
- Declaration
- Comments
- Using Scripting Elements
- Adding Scripting Elements in WSAD
- JSPs Implicit Objects
- Inserting Implicit Objects in WSAD
IV. JavaServer Pages - Part 2
- JSP Directives
- Page Directives
- Include Directives
- Taglib Directives
- Inserting JSP Directives in WSAD
- JSP Standard Actions
- <jsp:param>
- <jsp:inclue>
- <jsp:forward>
- <jsp:plugin>
- Adding Standard Actions in WSAD
V. JavaBeans
- JavaBeans Defined
- JavaBean Structure
- Naming Convention
- Properties
- A Simple Example
- Adding JavaBeans in JSP
- <jsp:useBean>
- <jsp:setProperty>
- <jsp:getProperty>
- Inserting JavaBeans in WSAD
- Exeption Handling
- What is an Exception
- Error and Exception
- Exception Hierarchy
- Runtime Exception
- Local Exception Handling
- Throwing an Exception
- Simple Rules for Exception Handling
- Creating your Exception
- Handling JSP Errors
VI. JDBC
- What is JDBC
- JDBC Driver Types
- Basic JDBC Interaction
- Load the driver
- Establish a Connection
- Execute SQL Statements
- Statement
- execute()
- executeQuery()
- executeUpdate()
- ResultSet
- Inserting a Record
- Updating a Record
- Deleting a Record
- Prepared Statement
- Callable Statement
VII. Servlet and JSP Interaction
- Calling a Servlet from JSP
- Using the FORM tag
- Using the <jsp:include> action
- Using the <jsp:forward> action
- Calling a JSP from a Servlet
- Using the RequestDispatcher
VIII. Architecting Web Applications
- Model 1 Architecture
- Model 2 Architecture
- Model
- View
- Controller
- Advantages of Model 2 Architecture