Java EE Web Applications

######  Web application:

       –  Responds to client requests using the HTTP protocol
       –  Typically implements an interactive Web site

######  The contents of a Web application can include:

        –  Java servlets
        –  JavaServer Pages (JSPs) for dynamic content
        –  Static content (HTML, CSS, images, and so on)
        –  Java classes and libraries
        –  Client-side libraries (JavaScript, Java Applets, and so on)
        –  XML deployment descriptors:
                     — Standard (web.xml)
                     — WebLogic specific (weblogic.xml)

#############   Packaging Web Applications   ##############

   You should package an application before it can be deployed to Oracle WebLogic Server
   To appropriately package a Web application, perform the following steps:
1). Arrange the resources in a prescribed directory structure.
2). Develop or copy the web.xml deployment descriptor (optional).
3). Develop or copy the weblogic.xml deployment descriptor (optional and WLS specific).
4). Archive the Web application into a .war file using Java Archive (JAR).
5). Deploy the Web application onto Oracle WebLogic Server.
6). Configure the Web application with the Oracle WebLogic Server Administration Console.

 ###########   Web Application Archive  ##############

Web archives are created using the jar utility:
Optional Configuration of Web Applications:
       Web applications can be specified in web.xml and weblogic.xml deployment descriptors.
       The configurations include:
     - Defining the run-time environment •
     – Mapping URLs to servlets and JSPs
     - Defining application defaults such as welcome and error pages
     - Specifying Java EE security constraints
     - Defining work managers for applications
     – Setting the context root for the application

web.xml:

   The web.xml file is used to configure the following:
     – Servlets and JSP registration
     - Servlet initialization parameters
     – JSP tag libraries
     – MIME type mappings
     - Welcome file list
     - Error pages
     - Security constraints and roles
     - Resources
     – EJB references

weblogic.xml:

     Using weblogic.xml, you can configure the following:
     – The application’s root context path
     – Application logging
     – Security role mappings
     - Advanced session settings
     – Session clustering
     - References to shared libraries
     – References to server resources (data sources, EJBs, and so on)
     - Work managers and threading
     - Virtual directories
     – JSP compiler options

###############   Web Service Applications   ##############

A Web service application:

   -  Responds to HTTP client requests using the Simple Object Access Protocol (SOAP)
   -  Uses the same structure as a Java EE Web application
   -  Supports two additional deployment descriptors:
              –webservices.xml
              –weblogic-webservices.xml

#############   Virtual Directory Mappings   ################

Virtual directories:

      -  Can be used to refer to physical directories
      -  Enable you to avoid the need to hard-code paths to physical directories
      -  Allow multiple Web applications to share common physical directories for specific requests
            such as images
      -  Decrease duplication of files across applications
      -  Are configured in weblogic.xml