Home | E-mail 

Java SCJP 6 Exam Download
Java SCJP 6 Exam Details

Exam Notes for the Sun Certified Web Component Developer (SCWCD) Exam

2. The Structure and Deployment of Modern Servlet Web Applications

2.1. Identify the following:

2.1.1. Structure of a Web Application
2.1.1.1. the following web application hierarchy is placed under a context root directory within the server's webapps directory (or something similar, depending on the server) :
2.1.1.1.1. /[any files to be served to the client, e.g. index.html, images/banner.gif]
2.1.1.1.2. /WEB-INF/web.xml
2.1.1.1.3. /WEB-INF/lib/[any required jar files]
2.1.1.1.4. /WEB-INF/classes/[servlet and support class files in their package hierarchies, e.g. com/mycorp/frontend/CorpServlet.class]
2.1.2. Structure of a Web Archive file
2.1.2.1. this is a JAR archive of the Web Application structure above; it just has a WAR extension so that people and tools know to treat it differently
2.1.2.2. a WAR file can be placed in a server's webapps directory, and the server will extract it on startup
2.1.3. Name of Web App deployment descriptor: web.xml
2.1.4. Name of directories where you place the following:
2.1.4.1. Web App deployment descriptor: see 2.1.1.2
2.1.4.2. Web App class file: see 2.1.1.4
2.1.4.3. Any auxhiliary JAR files: see 2.1.1.3
2.1.4.4.

2.2. Identify the purpose or functionality for each of the following deployment descriptor elements:

2.2.1. servlet instance:
2.2.1.1. <servlet> {servlet-name, servlet-class, init-param, etc.} </servlet>
2.2.1.2. declares a servlet instance; included within <web-app> </web-app> tags
2.2.2. servlet name:
2.2.2.1. <servlet-name></servlet-name>
2.2.2.2. registers the servlet under a specific name
2.2.3. servlet class:
2.2.3.1. <servlet-class></servlet-class>
2.2.3.2. contains the fully qualified class name of the servlet
2.2.4. initialization parameters:
2.2.4.1. <init-param> {param-name, param-value} </init-param>
2.2.4.2. defines values that can be set at deployment time and read at run-time via ServletConfig.getInitParameter(String name)
2.2.5. url to named servlet mapping
2.2.5.1. <servlet-mapping> <servlet-name> helloServlet </servlet-name> <url-pattern> /hello.html </url-pattern> </servlet-mapping> ß this maps http://server:port/context_root/hello.html to the helloServlet servlet.
2.2.5.2. zero or more mappings may be defined per web app
2.2.5.3. 4 types of mappings, searched in the following order: (a) explicit mappings, e.g. /hello.html (b) path prefix mappings e.g. /dbfile/* (c) extension mappings e.g. *.jsp or *.gif (d) the default mapping "/", identifying the default servlet for the web app

Java SCJP 6 Exam Download
Java SCJP 6 Exam Details

Previous                                                   Contents                                                         Next 

Privacy Policy Legal Contact webmaster Web design by anandsoft