WAR Directory Structure
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 directory 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.
********************************************************************************************************
********************************************************************************************************
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.
- DefaultWebApp/
- Place your static files, such as HTML files and JSP files in the directory that is the document root of your Web Application. In the default installation of WebLogic Server, this directory is calledDefaultWebApp, under user_domains/mydomain/applications.
Creating Web Applications: Main Steps
- Create the HTML pages and JavaServer Pages (JSPs) that make up the Web interface of the Web application. Typically, Web designers create these parts of a Web application.
- Write the Java code for the servlets and the JSP taglibs referenced in JSPs. Typically, Java programmers create these parts of a Web application.
- Compile the servlets into class files.
- Arrange the resources (servlets, JSPs, static files, and deployment descriptors) in the prescribed directory format. ( as above in red )
- Create the web.xml and weblogic.xml deployment descriptors.
The web.xml file defines each servlet and JSP page and enumerates enterprise beans referenced in the Web application. The weblogic.xml file adds additional deployment information for WebLogic Server.
- Package the HTML pages, servlet class files, JSP files, web.xml file, and weblogic.xml file into a WAR file.
Create a Web application staging directory and save the JSPs, HTML pages, and multimedia files referenced by the pages in the top level of the staging directory.
- Auto-deploy the WAR file on WebLogic Server for testing purposes.
- Deploy the WAR file on the WebLogic Server for production use or include it in an Enterprise ARchive (EAR) file to be deployed as part of an enterprise application.
No comments:
Post a Comment