Realdolmen Education

Détails

Java Servlets 3.0 and JSP Programming

Ce cours n'est actuellement pas prévu sur le calendrier ouvert, mais peuvent être organisé sur demande.

Demande de cours

Nombre de jours

3 day(s)

Audience

Java consultants, developers and architects

Prerequisites

Some experience with the Java programming language is required.

Objectives

This course teaches everything you need to know to be able to develop web applications using server-side Java.

Methods

Class training alternated with exercises. Each student will be able to work on a personal workstation for the duration of the course.

Description

The course starts by explaining how to build a web application using Servlets, and shows the benefits of Servlets and the Servlet component architecture. It will make clear how Servlets work inside a Servlet Container, and what is necessary to write your own Servlets. Participants will learn how to use the Servlet API for generating HTML, to create and send Cookies, to do session management and server-side redirects.

The course continues with an introduction to the JSP technology and how JSP complements the servlet technology for representing HTML. The different JSP tags and short-hand notations are explained, as well as the use of JavaBeans to represent data.

At the end of the course, the participants will learn how to combine the Servlet and JSP technologies to create Model-2 Applications, using the Model-View-Controller Pattern. This will enable them to create more reliable and maintainable web applications. Additional topics include JSP Standard Tag Library (JSTL) and the creation of custom tags.

During the course there are numeral exercises, giving the participants some practical experience with the use of both Servlets and JSP. At the end of the course, participants will be able to create web applications using the standard web components of the Java Enterprise Edition, which will increase their understanding of common web frameworks such as Struts and JSF.

Contents

  • Introduction

    • Java Servlets and JSP Programming
    • Agenda
  • J2EE Overview

    • What is J2EE?
    • The Java 2 Platform
    • What do I get from J2EE?
    • Trends
    • Single VS Multi-Tier
    • Monolytical VS Object-based
    • Open Issues
    • Propriety Solution
    • Open-standard Solution
    • Why J2EE?
    • Overview of the J2EE API?s
    • J2EE: End-to-End Architecture
    • Containers and Components
    • J2EE Development Lifecycle
    • Deployment Descriptor
    • J2EE Anatomies
    • J2EE Reference
    • J2EE BluePrint
    • Why J2EE for Web Services?
    • J2EE Summary
  • Server Setup and Configuration

    • Tomcat
    • Tomcat Installation
    • Checking the Installation
    • Running Examples
    • Changing the Default Port
    • Adding the ?admin? Package
    • Tomcat Directories
    • A Web Application Directory Structure
    • Server Setup and Configuration Summary
    • Exercise
  • Servlets

    • What are Servlets?
    • A Servlet?s Job
    • Why build Web pages dynamically ?
    • Servlets Are Lightweight
    • Advantages of Servlets over ?Traditional? CGI
    • Web Applications
    • Web Applications are easy to develop
    • Server Requirements
    • Servlet Engine
    • Servers Supporting Servlets
    • Servlets in the Java Platform
    • A simple Servlet that generates text
    • XML based configuration
    • Servlets 3.0
    • @WebServlet
    • Generating HTML
    • A simple Servlet that generates HTML
    • Exercise
    • The Servlet Framework
    • The Servlet Life Cycle
    • Initializing a Servlet
    • Providing init parameters
    • Destroying a Servlet
    • Handling Requests
    • Anatomy of a Request
    • Requests in Action
    • The Request Object
    • Frequently Used Request Methods
    • The Response Object
    • Frequently Used Response Methods
    • Handling GET & POST requests
    • SnoopServlet Example
    • HTTP Status Codes
    • The Potential of Cookies
    • Some Problems with Cookies
    • Sending Cookies to Browser
    • Reading Cookies from Browser
    • Methods in the Cookie API
    • Why Session Tracking
    • Implementing your own Session Tracking: Cookies
    • Implementing your own Session Tracking: URL-Rewriting
    • Implementing your own Session Tracking: Hidden Form Fields
    • The Session Tracking API
    • Session Example
    • HttpSession Methods
    • Servlets are Not Just for HTML
    • Image Generation Example
    • HTTP Tunneling
    • Using Properties in Client & Server Communication
    • Using Serialization in Client & Server Communication
    • What are the Servlet Listeners
    • ServletContextListener
    • ServletContextAttributeListener
    • HttpSessionListener
    • HttpSessionAttributeListener
    • Listeners in web.xml
    • What is a Servlet Filter ?
    • Possibilities of Servlet Filters
    • Servlet Filtering Example
    • Access Log Servlet Filter Example
    • Configuring Filters in web.xml
  • JavaServer Pages (JSP)

    • The Need for JSP
    • The JSP Framework
    • Benefits of JSP
    • JSP Example
    • Exercise
    • Creation of a JSP Class File
    • JSP Access Model
    • JSP History
    • JSP Tags
    • JSP Tags - Scriptlet
    • Scriptlet Example
    • Predefined Variables
    • Predefined Variables Example
    • JSP Tags - Expression
    • Scriptlet & Expression Example
    • Using Scriptlets to Make Conditional JSP Files
    • JSP Tags - Declaration
    • Declaration Example
    • JSP Page directives
    • Including Files at Request Time
    • Including Files at Page Translation Time
    • Differences Between jsp:include and @include
    • Including Applets for the Java Plugin
    • <jsp:forward
    • Comments
    • Background: What are JavaBeans ?
    • Why Accessors and No Public Fields
    • JSP Tags - Actions
    • Basic Bean Use in JSP
    • Accessing Bean Properties
    • Setting Bean Properties ? Simple Case
    • StringBean Example
    • Setting Bean Properties Explicit Conversion & Assignment
    • Setting Bean Properties Associating Properties with param
    • Setting Bean Properties Associating All Properties with param
    • JSP Tags - Actions scope
    • Scope Example
    • Why Combine Servlets & JSP?
    • Approach
    • Implementing MVC
    • Storing the Results
    • Forwarding Requests to JSP Pages
  • Architectural Overview

    • Model 1 Architecture
    • Model 2 Architecture
  • Expression Language (EL)

    • Expression Language (EL)
    • EL Example
    • Accessing Scoped Variables
    • Example ScopedVars
    • Accessing Bean Properties
    • Array Notation
    • Referencing Implicit Objects
    • Using EL Operators
  • JavaServer Pages Standard Tag Library (JSTL)

    • JSTL Overview
    • JSTL Tag libraries
    • Core library
    • Formatting library
    • JSTL Examples
    • Exercise
  • Custom tags

    • Custom Tags
    • Custom Tag Libraries
    • JSP Custom Tag Example
    • JSP Tag fragments
    • Tag fragment files
    • Using Tag fragment libraries
    • Custom Java Tags versus JSP Tag fragments
    • When to use what?
  • JSP Documents: JSPX

    • JSP Hybrid
    • Analogy to JSP, HTML and XML
    • Evolution of HTML and XML
    • The end of XHTML
    • JSPX: Pros and cons
    • Creating a JSPX document
    • Porting JSP to JSPX
    • Exercise
  • Summary

    • Summary