table of contents

Sun Certified Web Component Developer (SCWCD)

Review and Exam Prep

The training materials on this page are taken from Marty's live SCWCD exam preparation course. This course and several similar J2EE courses have been given by Marty in the US, Canada, Australia, Puerto Rico, Japan, Mexico, and the Philippines. See the training materials home page for Jakarta Struts tutorials, Apache Tomcat tutorials, JSF tutorials, Java 5 & Java 6 tutorials, and tutorials in Chinese and Japanese.

The PDF versions of the tutorials are freely available to anyone for personal use. These versions contain the complete text of the PowerPoint slides, and are what you want if your goal is to learn or review the technology. As a courtesy, coreservlets.com also makes the original PowerPoint slides available to faculty teaching university courses that do not compete with Marty's live courses. See the J2EE instructor materials page for details.

To arrange an SCWCD course at your organization based on these materials, contact info@coreservlets.com. These courses can be customized to use any combination of the materials on the J2EE tutorials site, and new materials can be added for specific client needs. To learn more details about the instructor, the curriculum for the live training courses, or the public course schedule, please see http://courses.coreservlets.com.

If you find these free tutorials helpful, we would appreciate it if you would link to us.

Source Code

Source code for the examples from the first half of the review can be downloaded from Source Code For First Part and from the second half of the review from Source Code For Second Part. Also check out the SCWCD practice exercises with cross-references to the SCWCD exam objectives.


Servlets & JSP: Overview and Setup

View PDF of Servlet Overview and Setup
Free for personal use.

Topics:

  • Understanding the role of servlets
  • Evaluating servlets vs. other technologies
  • Understanding the role of JSP
  • Configuring the server
  • Configuring your development environment
  • Testing the server setup

Servlet Basics

View PDF of Servlet Basics
Free for personal use.

Topics:

  • The basic structure of servlets
  • A simple servlet that generates plain text
  • A servlet that generates HTML
  • Servlets and packages
  • Some utilities that help build HTML
  • The servlet life cycle
  • Servlet debugging strategies

Handling the Client Request: Form Data

View PDF of Handling Form Data
Free for personal use.

Topics:

  • The role of form data
  • Creating and submitting HTML forms
  • Reading individual request parameters
  • Reading the entire set of request parameters
  • Handling missing and malformed data
  • Dealing with incomplete form submissions
  • Filtering special characters out of the request parameters

Handling the Client Request: HTTP Request Headers

View PDF of Handlilng Request Headers
Free for personal use.

Topics:

  • Reading HTTP request headers
  • Building a table of all the request headers
  • Understanding the various request headers
  • Reducing download times by compressing pages
  • Differentiating among types of browsers

Generating the Server Response: HTTP Status Codes

View PDF of HTTP Status Codes
Free for personal use.

Topics:

  • Format of the HTTP response
  • How to set status codes
  • What the status codes are good for
  • Shortcut methods for redirection and error pages
  • A servlet that redirects users to browser-specific pages
  • A front end to various search engines

Generating the Server Response: HTTP Response Headers

View PDF of HTTP Response Headers
Free for personal use.

Topics:

  • Format of the HTTP response
  • Setting response headers
  • Understanding what response headers are good for
  • Building Excel spread sheets
  • Generating JPEG images dynamically
  • Sending incremental updates to the browser

Handling Cookies

View PDF of Handling Cookies
Free for personal use.

Topics:

  • Understanding the benefits and drawbacks of cookies
  • Sending outgoing cookies
  • Receiving incoming cookies
  • Tracking repeat visitors
  • Specifying cookie attributes
  • Differentiating between session cookies and persistent cookies
  • Simplifying cookie usage with utility classes
  • Modifying cookie values
  • Remembering user preferences

Session Tracking

View PDF of Session Tracking
Free for personal use.

Topics:

  • Implementing session tracking from scratch
  • Using basic session tracking
  • Understanding the session-tracking API
  • Differentiating between server and browser sessions
  • Encoding URLs
  • Storing immutable objects vs. storing mutable objects
  • Tracking user access counts
  • Accumulating user purchases
  • Implementing a shopping cart
  • Building an online store

JSP Introduction & Overview

View PDF of JSP Intro
Free for personal use.

Topics:

  • Understanding the need for JSP
  • Evaluating the benefits of JSP
  • Comparing JSP to other technologies
  • Avoiding JSP misconceptions
  • Understanding the JSP lifecycle
  • Installing JSP pages
  • Looking at JSP in the real world

Invoking Java Code with JSP Scripting Elements

View PDF of JSP Scripting Elements
Free for personal use.

Topics:

  • Static vs. dynamic text
  • Dynamic code and good JSP design
  • JSP expressions
  • Servlets vs. JSP pages for similar tasks
  • JSP scriptlets
  • JSP declarations
  • Predefined variables
  • Comparison of expressions, scriptlets, and declarations

Controlling the Structure of Generated Servlets: The JSP page Directive

View PDF of JSP page Directive
Free for personal use.

Topics:

  • Understanding the purpose of the page directive
  • Designating which classes are imported
  • Specifying the MIME type of the page
  • Generating Excel spreadsheets
  • Participating in sessions
  • Setting the size and behavior of the output buffer
  • Designating pages to handle JSP errors
  • Controlling threading behavior

Including Files and Applets in JSP Pages

View PDF of JSP File Inclusion
Free for personal use.

Topics:

  • Using jsp:include to include pages at request time
  • Using <%@ include ... %> (the include directive) to include files at page translation time
  • Understanding why jsp:include is usually better than the include directive
  • Using jsp:plugin to include applets for the Java Plug-in

Using JavaBeans Components in JSP Documents

View PDF of Using JavaBeans
Free for personal use.

Topics:

  • Understanding the benefits of beans
  • Creating beans
  • Installing bean classes on your server
  • Accessing bean properties
  • Explicitly setting bean properties
  • Automatically setting bean properties from request parameters
  • Sharing beans among multiple servlets and JSP pages

The Model View Controller (MVC) Architecture: Integrating Servlets and JSP

View PDF of MVC
Free for personal use.

Topics:


The JSP 2.0 Expression Language: Simplifying MVC and Access to Java Code

View PDF of JSP Expression Language
Free for personal use.

Topics:

  • Motivating use of the expression language
  • Understanding the basic syntax
  • Understanding the relationship of the expression language to the MVC architecture
  • Referencing scoped variables
  • Accessing bean properties, array elements, List elements, and Map entries
  • Using expression language operators
  • Evaluating expressions conditionally

Using and Deploying Web Applications

View PDF of Web Applications
Free for personal use.

Topics:

  • Purpose of Web applications
  • Structure of Web applications
  • Setting up Web applications with Tomcat
  • Sharing data among Web applications

Controlling Web Application Behavior: The Deployment Descriptor web.xml

View PDF of Deployment Descriptor web.xml
Free for personal use.

Topics:

  • Location and purpose of web.xml
  • Custom URLs
  • Initialization parameters
    • Servlets
    • JSP Pages
  • Preloading pages
  • Welcome pages
  • Error pages

Declarative Web Application Security

View PDF of Declarative Security
Free for personal use.

Topics:

  • Major security concerns
  • Declarative vs. programmatic security
  • Using form-based authentication
  • Using BASIC authentication

Programmatic Security

View PDF of Programmatic Security
Free for personal use.

Topics:

  • Problems with declarative security
    • The advantages of declarative security usually outweigh the disadvantages. But not always.
  • Combination security: mixing server-managed and servlet-managed (programmatic) security
    • Solve one of the drawbacks of declarative security with only a little bit of extra work.
  • Pure programmatic security
    • Solve the other drawbacks, but with a very lot of extra work.

Servlet and JSP Filters

View PDF of Servlet and JSP Filters
Free for personal use.

Topics:

  • Filter basics
  • Accessing the servlet context
  • Using initialization parameters
  • Blocking responses
  • Modifying responses

The Web Application Life-Cycle Events Framework

View PDF of Life-Cycle Listeners
Free for personal use.

Topics:

  • Reason for listeners
  • Monitoring creation and destruction of the servlet context
  • Detecting changes in servlet context attributes
  • Recognizing session creation and destruction
  • Watching for changes in session attributes
  • Combining activities

Creating Custom JSP Tag Libraries: The Basics

View PDF of Basic Custom Tags
Free for personal use.

Topics:

  • Java-based tags
    • Components of a tag library
    • Basic tags
    • Tags that use attributes
    • Tags that use body content
    • Tags that optionally use body content
  • JSP-based tags (tag files)
    • Components of a tag library
    • Basic tags
    • Tags that use attributes
    • Tags that use body content
  • More Info: Updated source code here. These examples have been updated to JSP 2.0, so the code is substantially different than in the More Servlets & JSP source code archive used for the second half of the SCWCD review materials.

Creating Custom JSP Tag Libraries: Advanced Topics

View PDF of Advanced Custom Tags
Free for personal use.

Topics:

  • Tags with dynamic attribute values
  • Tags with complex objects for attributes
  • Manipulating the tag body
  • Looping tags
  • Nested tags
  • Using SAX and TagLibraryValidator to validate tag library syntax
  • More Info: Updated source code here. These examples have been updated to JSP 2.0, so the code is substantially different than in the More Servlets & JSP source code archive used for the second half of the SCWCD review materials.

Creating Custom JSP Tag Libraries: Classic Syntax

View PDF of Classic Custom Tags
Free for personal use.

This topic is only of interest for the sake of the SCWCD exam. For real-world development purposes, stick with the SimpleTagSupport API discussed in the previous two sections.

Topics:

  • Java-based tags
    • Components of a tag library
    • Basic tags
    • Tags that use attributes
    • Tags that use body content
    • Tags that optionally use body content

The JSP Standard Tag Library (JSTL)

View PDF of JSTL
Free for personal use.

Topics:

  • Obtaining JSTL documentation and code
  • The JSTL Expression Language
  • Looping Tags
  • Using JSTL to simplify Ajax data generation
  • Conditional Evaluation Tags
  • Database Access Tags
  • Other Tags

Accessing Databases with JDBC

View PDF of JDBC
Free for personal use.

Topics:

  • Overview of JDBC technology
  • JDBC drivers
  • Seven basic steps in using JDBC
  • Using JNDI with JDBC
  • Retrieving data from a ResultSet
  • Using prepared and callable statements
  • Submitting multiple statements as a transaction

Sample Exercises

View PDF of Sample Exercises
Free for personal use.

The the live training courses are in lecture/lab format, and these are a sample of the exercises. There is one set of exercises for each topic of the tutorials, and the exercises are meant to illustrate the most important techniques of that topic. Each set of exercises also has specific cross references to the SCWCD exam objectives. You will learn a lot more by doing exercises in conjunction with reading the tutorials than by reading alone. Try them!
Sorry: solution sets are only given out in the classes.


More Information

Java

JSF (JavaServer Faces)

Servlets & JSP
Ajax, GWT, & JavaScript

Spring, Hibernate, & JPA

Struts