CERTguide Sun Certified Web Component Developer Study Guide

What is the Java Web Component Developer Exam all about?

According to Sun:

“This certification is for Sun Certified Programmers for Java[tm] 2 Platform 1.2 who are using the Java technology servlet and JavaServer Pages[tm] (JSP[tm]) APIs to develop Web applications. Certification is available for the Java 2 Platform, Enterprise Edition (J2EE[tm]). The certification consists of one exam and requires Sun Certified Programmer for Java 2 Platform 1.2 status.”

You need to take one exam on top of your CJP designation. This exam consists of MC and Fill in the blank questions.

This exam has its focus on Servlets and JSP.

There is no coverage on XML as yet. However, HTTP is covered heavily. Make sure you know HTTP inside and out.

You need to obtain CJP before attempting this certification. You must be extremely good at using Java if you want to succeed. Refer to the CERTguide CJP Study Guide for the necessary study information.

Know the specifications:

One best way to learn Servlet and JSP is to refer to the official specification documents. Visit http://www.jcp.org/aboutJava/communityprocess/final/jsr053/ and download the following:

n          Java Servlet 2.3

n          JavaServer Pages 1.2

 

Learn

It is highly recommended that you download and study the Java Web Services Tutorial v1.0 which is available at http://java.sun.com/webservices/tutorial.html .

Pay attention to the following sections:

n          Web Technology 

n          Case Study 

Practice

Apart from the Java 2 SDK, you need to download the JavaServer Web Developer Pack V1.0 at http://java.sun.com/webservices/downloads/webservicespack.html .

According to Sun:

“Java Web Services Developer Pack: Java WSDP 1.0 is now generally available. Java WSDP 1.0 includes the latest implementations of JSTL 1.0, JSP 1.2, and Servlet 2.3 and is a great vehicle for developing Web applications as well as Web services.”

“The JavaTM Web Services Developer Pack (Java WSDP) is an integrated toolset that in conjunction with the Java platform allows Java developers to build, test and deploy XML applications, Web services, and Web applications. The Java WSDP provides Java standard implementations of existing key Web services standards including WSDL, SOAP, ebXML, and UDDI as well as important Java standard implementations for Web application development such as JavaServer PagesTM (JSPTM pages) and the JSP Standard Tag Library. These Java standards allow developers to send and receive SOAP messages, browse and retrieve information in UDDI and ebXML registries, and quickly build and deploy Web applications based on the latest JSP standards.”

What is HTTP?

n          Short for HyperText Transfer Protocol

n          a stateless protocol

Why stateless? According to webopedia.com:

"The World Wide Web, on the other hand, is intrinsically stateless because each request for a new Web page is processed without any knowledge of previous pages requested. This is one of the chief drawbacks to the HTTP protocol. Because maintaining state is extremely useful, programmers have developed a number of techniques to add state to the World Wide Web. These include server APIs, such as NSAPI and ISAPI, and the use of cookies." http://www.webopedia.com/TERM/s/stateless.html

n          defines how messages are formatted and transmitted

n          defines what actions Web servers and browsers should take in particular situations

n          each command is executed independently

n          there is no knowledge between commands

HTTP Headers

Common HTTP Request Headers:

Header

Uses

Accept

The MIME types the browser prefers.

Accept-Charset

The character set the browser expects.

Accept-Encoding

The types of data encodings the browser uses to decode.

Accept-Language

The language the browser is expecting

Authorization

Authorization info in response to a WWW-Authenticate header

Connection

Use persistent connection

Content-Length

how much data is attached

Cookie

 

From

email address of requester

Host

host and port listed in the original URL

Pragma

with a no-cache value, the server should return a fresh document

Referer

the URL of the page containing the link the user followed

Common HTTP Response Headers:

Header

Use

Allow

What request methods are allowed by the server?

Content-Encoding

What method for encoding the document?

Content-Length

How many bytes to send?

Content-Type

What is the MIME type of a document?

Date

What is the current time in GMT?

Expires

When should content be considered out of date and thus no longer cached?

Last-Modified

When was document last changed?

Location

Where should client go to get document?

Refresh

How soon should browser ask for an updated page in seconds?

Server

What server is it?

Set-Cookie

Specifies the cookie to be produced and used

WWW-Authenticate

What authorization type and realm should client supply in their Authorization header?

HTTP Status Codes

Status Code for HTTP 1.1

Message

100

Continue

101

Switching Protocols

200

OK

201

Created

202

Accepted

203

Non-Authoritative Information

204

No Content

205

Reset Content

206

Partial Content

300

Multiple Choices

301

Moved Permanently

302

Found

303

See Other

304

Not Modified

305

Use Proxy

307

Temporary Redirect

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

405

Method Not Allowed

406

Not Acceptable

407

Proxy Authentication Required

408

Request Timeout

409

Conflict

410

Gone

411

Length Required

412

Precondition Failed

413

Request Entity Too Large

414

Request URI Too Long

415

Unsupported Media Type

416

Requested Range Not Satisfiable

417

Expectation Failed

500

Internal Server Error

501

Not Implemented

502

Bad Gateway

503

Service Unavailable

504

Gateway Timeout

505

HTTP Version Not Supported

Since HTTP is stateless, cookies are needed to “chain” sessions together.

What are cookies?

n          text files

n          reside on the client computers

n          created by the server

n          main purpose - identify users and prepare customized Web pages for them

n          client information is packaged into a cookie and sent to the Web browser which stores it for later use

Alternatives to cookies:

n          URL Rewriting

u        append extra data on the end of each URL that identifies the session

u        the server can associate the session identifier with data it has stored about that session

u        it works with browsers that don't support cookies

n          Hidden form fields

u        reside in HTML forms

u        store information about the session

u        when the form is submitted, the specified name and value are included in the GET or POST data

u        only works if page is dynamically generated

Servlet’s Session Tracking API

n          the HttpSession API

n          an outstanding technical solution to cookies and URL rewriting

n          a high-level interface built on top of cookies

n          author doesn't need to explicitly manipulate cookies or information appended to the URL

According to “Servlets and JavaServer Pages (JSP) 1.0: A Tutorial":

“Using sessions in servlets is quite straightforward, and involves looking up the session object associated with the current request, creating a new session object when necessary, looking up information associated with a session, storing information in a session, and discarding completed or abandoned sessions.” http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/

What is Servlet?

n          a type of Java applet - Java application components that are downloaded on demand

n          100% pure Java

n          involve no platform-specific consideration or modifications

n          runs on a server - Servlets can be used to extend the capabilities of a web server

n          usually runs within a Web server environment - Servlets fit seamlessly into a web server framework

n          becoming increasingly popular as an alternative to CGI programs

n          persistent - once it is started, it stays in memory and can fulfill multiple requests

n          run faster as there's no wasted time in setting up and tearing down the process

Advantage of Servlets Over CGI:

n          Efficient – no need to span new threads everytime

n          Convenient – no need to learn other scripting lanaguges

n          Powerful - can talk directly to the Web server

n          Portable – 100% written in Java

n          Inexpensive – can be used with the free Web servers available

What is JSP?

n          Short for Java Server Page

n          server-side

n          an extension to the Java servlet technology

n          dynamic scripting capability - works in tandem with HTML code - provides a more convenient way to code a servlet

n          processes HTTP requests and generates responses like any servlet.

n          separate the page logic from the static elements

n          translated into Java servlet before being run

n          JSP translator is triggered by the .jsp file name extension in a URL

According to “Servlets and JavaServer Pages (JSP) 1.0: A Tutorial":

“Java Server Pages (JSP) is a technology that lets you mix regular, static HTML with dynamically-generated HTML. Many Web pages that are built by CGI programs are mostly static, with the dynamic part limited to a few small locations. But most CGI variations, including servlets, make you generate the entire page via your program, even though most of it is always the same. JSP lets you create the two parts separately.” http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/

JSP Syntax

Language Element

Syntax

JSP Expression

<%= expression %>

JSP Scriptlet

<% code %>

JSP Declaration

<%! code %>

JSP page Directive

<%@ page att="val" %>

JSP include Directive

<%@ include file="url" %>

JSP Comment

<%-- comment --%>

The jsp:include Action

<jsp:include
    page="relative URL"
    flush="true"/>

The jsp:useBean Action

<jsp:useBean att=val*/> or
<jsp:useBean att=val*>
...
</jsp:useBean>

The jsp:setProperty Action

<jsp:setProperty att=val*/>

The jsp:getProperty Action

<jsp:getProperty
    name="propertyName"
    value="val"/>

The jsp:forward Action

<jsp:forward
    page="relative URL"/>

The jsp:plugin Action

<jsp:plugin
    attribute="value"*>
  ...
</jsp:plugin>

What is the relationship between JSP and Servlet?

n          JavaServer Pages technology is an extension of the Java Servlet technology.

n          JSP technology and servlets provide an attractive alternative to other types of dynamic web scripting/programming that offers:

u        platform independence

u        enhanced performance

u        separation of logic from display

u        ease of administration

u        extensibility into the enterprise

u        ease of use

 

Reference Books

Professional JSP 2nd Edition -- Simon Brown, et al; Mass Market Paperback

http://www.amazon.com/exec/obidos/ASIN/1861004958/edsspace

Java for the Web with Servlets, JSP, and EJB: A Developer's Guide to J2EE Solutions

by Budi Kurniawan (Paperback)

http://www.amazon.com/exec/obidos/ASIN/073571195X/edsspace

Jsp: The Complete Reference (Complete Reference)

by Phil Hanna (Paperback - March 2001)

http://www.amazon.com/exec/obidos/ASIN/0072127686/edsspace

Advanced JavaServer Pages

by David Geary (Paperback)

http://www.amazon.com/exec/obidos/ASIN/0130307041/edsspace

Web Protocols and Practice: HTTP/1.1, Networking Protocols, Caching, and Traffic Measurement -- by Balachander Krishnamurthy, Jennifer Rexford; Hardcover

http://www.amazon.com/exec/obidos/ASIN/0201710889/edsspace

HTTP Essentials: Protocols for Secure, Scaleable Web Sites -- by Stephen Thomas; Paperback

http://www.amazon.com/exec/obidos/ASIN/0471398233/edsspace

Hypertext Transfer Protocol HTTP 1.0 Specifications

by World Wide Web Consortium

http://www.amazon.com/exec/obidos/ASIN/1583482709/edsspace

 

This study guide is developed by Michael Yu Chak Tin. He can be reached at Michael@examreview.net.

 

   
Join our mailing list
Name:
Email Address:
Choose a Newsletter(s):
Updates Newsletter
70-210 exam
70-215 exam
70-216 exam
70-217 exam
Network+ exam
CCNA exam
A+ Core exam
A+ OS exam
Linux+ exam
70-221 exam
Delivery Format:
Manage Subscriptions