|
|
| |
The following sections describe how to configure and deploy Web Applications:
A Web Application contains an application's resources, such as servlets, JavaServer Pages (JSP), JSP tag libraries, and static resources such as HTML pages and image files. A Web Application can also define links to resources outside of the application such as Enterprise JavaBeans (EJBs). Web Applications deployed on WebLogic Server use a standard J2EE deployment descriptor in conjunction with an optional WebLogic-specific deployment descriptor to define the resources and their operating parameters.
JSP pages and HTTP servlets can access all services and APIs available in WebLogic Server. These services include EJBs, database connections through Java Database Connectivity (JDBC), JavaMessaging Service (JMS), XML, and more.
Web Applications use a standard directory structure defined in the J2EE specification and can be deployed as a collection of files that use this directory structure (this type of deployment is called exploded directory format) or as an archived file called a .war file. Deploying a Web Application in exploded directory format is recommended primarily for use while developing your application. Deploying a Web Application as a .war file is recommended primarily for production environments.
The WAR file can be deployed alone or packaged in an Enterprise Archive (EAR file) with other application components. If deployed alone, the archive must end with a .war extension. If deployed in an EAR file, the archive must end with an .ear extension. (Note: If you are deploying an entire directory, do not name the directory .ear, .war, .jar and so on.)
Main Steps to Create a Web Application
The following steps summarize the procedure for creating a Web Application. You may want to use some of the provided developer tools for creating and configuring Web Applications. For more information, see Web Application Developer Tools.
To create a Web Application:
For detailed instructions, see Writing the web.xml Deployment Descriptor.
You can also use the Administration Console to edit Web Application deployment descriptors. For more information, see Web Application Deployment Descriptor Editor Help.
For detailed instructions on creating the WebLogic-specific deployment descriptor, see Writing the WebLogic-Specific Deployment Descriptor (weblogic.xml).
You can also use the Administration Console to edit Web Application deployment descriptors. For more information, see Web Application Deployment Descriptor Editor Help.
jar cv0f myWebApp.war .
This command creates a Web Application archive file called myWebApp.war.
You develop your Web Application within a specified directory structure so that it can be archived and deployed on WebLogic Server, or another J2EE compliant server. All servlets, classes, static files, and other resources belonging to a Web Application are organized under a directory hierarchy. The root of this hierarchy defines the document root of your Web Application. All files under this root directory can be served to the client, except for files under the special directory WEB-INF, located under the root directory. The name of your Web Application is used to resolve requests for components of the Web Application.
Place private files in the WEB-INF directory, under the root directory. All files under WEB-INF are private, and are not served to a client.
You construct the URL used to access a Web Application from a client by using the following pattern:
http://hoststring/ContextPath/servletPath/pathInfo
Where
If you are using virtual hosting, you can substitute the virtual host name for the hoststring portion of the URL.
For additional information, see How WebLogic Server Resolves HTTP Requests.
Web Application Developer Tools
BEA provides several tools you can use to help you create and configure Web Applications. These tools are described in this section.
ANT Tasks to Create Skeleton Deployment Descriptors
You can use the WebLogic ANT utilities to create skeleton deployment descriptors. These utilities are Java classes shipped with your WebLogic Server distribution. The ANT task looks at a directory containing a Web Application and creates deployment descriptors based on the files it finds in the Web Application. Because the ANT utility does not have information about all of the desired configurations and mappings for your Web Application, the skeleton deployment descriptors the utility creates are incomplete. After the utility creates the skeleton deployment descriptors, you can use a text editor, an XML editor, or the Administration Console to edit the deployment descriptors and complete the configuration of your Web Application.
For more information on using ANT utilities to create deployment descriptors, see Packaging Web Applications.
Web Application Deployment Descriptor Editor
The WebLogic Server Administration Console has an integrated deployment descriptor editor. You must create at least a skeleton web.xml deployment descriptor before using this integrated editor.
For more information, see Web Application Deployment Descriptor Editor Help.
BEA now provides a simple, user-friendly tool from Ensemble for creating and editing XML files. It can validate XML code according to a specified DTD or XML Schema. The XML editor can be used on Windows or Solaris machines and is downloadable from BEA dev2dev.
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|