Java
  Home arrow Java arrow Page 3 - Overview of Java Web Technologies, Part 1
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
JAVA

Overview of Java Web Technologies, Part 1
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 24
    2004-03-01


    Table of Contents:
  • Overview of Java Web Technologies, Part 1
  • Methods
  • Creating a Servlet Directory Structure
  • Reviewing Deployment Descriptors
  • Servlet Mapping
  • Defining Context Parameters
  • Retrieving Context Parameters
  • Listening to Application Events
  • Packaging and Deploying a Web Application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Overview of Java Web Technologies, Part 1 - Creating a Servlet Directory Structure
    ( Page 3 of 9 )

    To run your servlet applications, you need a servlet container. One such container is Tomcat, the most popular container, which is an open-source project. The code in this book was tested using Tomcat, but you can use any Servlet 2.3-compliant servlet container to run it.

    NOTE: JSF is currently based on the Servlet 2.3 specification, but this may change. The release version may be based on the Servlet 2.4 specification (to be released soon also).

    When you first install Tomcat (Appendix A provides step-by-step instruction on installing and configuring Tomcat), several directories are created under the directory in which you install Tomcat. Tomcat’s directory structure is shown in Figure 1.
     

    Tomcat
    Figure 1 Tomcat’s directory structure.

    In Figure 1, Tomcat is installed in the tomcat5 directory. This directory is also known as %CATALINA_HOME%. One of the subdirectories is webapps. This is the parent directory of every Web application that will be run under this Tomcat installation.

    When you first install Tomcat, a number of sample applications are also created: jspexamples, ROOT, servlets-examples, and tomcat-docs. Therefore, a directory under webapps is called an application directory, and it contains the resources for a particular application. For an example of an application directory structure, look at the jsp-examples application directory.

    Directly beneath an application directory is a directory called WEB-INF, which has special significance in a Web application. Under WEB-INF, you can have a classes directory and a lib directory. The classes directory contains all servlet classes and other Java classes used by the Web application. The directory structure under classes must represent the fully qualified name of the Java class. For example, if you have a servlet class called ch01.MyServlet, you must create a ch01 directory under classes and put the MyServlet.class file in classes/ch01. The lib directory, if one exists, contains all libraries (.jar files) referenced by any resource in the Web application.

    All static resources and JSP files are stored directly under the application directory. For better organization, you can create subdirectories under the application directory. For example, you may want to create a jsp directory for all JSP pages and an images
    directory for all your image files. A Web client can access anything you put under the application directory, except those under WEB-INF, because WEB-INF is a special directory.

    A Web application normally has a deployment descriptor, which is an XML file called web.xml containing the description of the application. You store the web.xml file under WEB-INF. We’ll take a look at the deployment descriptor in the next section.

    Buy this book now!Remember: This is part one of the first chapter of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983). Stay tuned for part 2 of "Overviews of Java Web Technologies," where we learn about JSP, JavaBeans, and Model 2. 
    Buy this book!



     
     
    >>> More Java Articles          >>> More By McGraw-Hill/Osborne
     

       

    JAVA ARTICLES

    - Exception Handling Techniques in Java
    - More About Multithreading in Java
    - The Basics of Multiple Threads in Java
    - Data Access Using Spring Framework JDBC
    - New Object Initialization in Java
    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek