Java - Web Application (Web Module) - War

Java Conceptuel Diagram

About

Web application in Java.

A Java web application serve and/or generates interactive HTML web pages.

An enterprise application may contain zero or more web applications.

Format

War

A web application is generally deliverd as a war file (Web Archive). It's JAR files renamed to a .war (web archive) extension.

The deployment unit is an archive file containing all files.

Archive files are typically created by using the jar utility or Ant's jar tool. See Java - Packaging, Archive, Library (JAR, WAR, EAR File)

Content

The war file is a hierarchical set of folders with:

  • Java classes and jar files
  • static files, (HTML, JavaScript, image, files and resources)
  • directories,
  • web component (servlet class files, jsp, jsf) for the front end / presentation layer
  • JavaBeans for the business logic layer
  • ressource, such as image files
  • An application configuration resource file, which configures application resources
  • An set of tag library descriptor files (for Jsf Application)

Deployment Descriptor

XML Deployment Descriptors

And a web app server descriptor to at minimum defined the context root

  • WebLogic - WEB-INF/weblogic.xml

See Java - Deployment descriptors (Metadata)

Files

A War is a special JAR file with special treatment for files that should end up in the :

  • WEB-INF/lib,
  • WEB-INF/classes
  • or WEB-INF directories

Example

For example, a Java Server Faces web application WAR file using Facelets typically has the following directory structure:

myWebApp/
  WEB-INF/
    web.xml
    weblogic.xml
    lib/
      MyLib.jar
    classes/
      MyPackage/
        MyServlet.class
  index.html
  index.jsp

Management

create

Zie Java - Packaging, Archive, Library (JAR, WAR, EAR File)

jar cvf myWar.war myApp





Discover More
Java Conceptuel Diagram
J2EE - (Web) Resources

(Web) Resources are any software artifacts that the web application requires for proper rendering, including: images, script files, and any user-created component libraries. A Resource may be...
Java Conceptuel Diagram
J2EE - Web.xml (Deployment descriptor of a Web Application)

The web.xml file is the deployment descriptor file for a web application. It's a J2EE standard XML document that configures the contents of a WAR file. You can override any of the default servlet parameters...
Java Conceptuel Diagram
J2EE - Web.xml - How do I define an environment variable that can be accessed in all servlets in a Web application ?

A J2EE application may require one or more initialization parameters to be accessed by one or more servlets in a web application. An initialization parameter be for a context or for a specific servlet....
Java Conceptuel Diagram
Java - Application

An application in shipped in an archive format with a main class that contains a main method that starts the application. instancejava/lang/Runtimeclass RuntimeOperating System environment ...
Java Conceptuel Diagram
Java - Deployment descriptors (Metadata)

Deployment descriptors are XML documents included in the JARs that describes: component's configuration, deployment settings of an application, a module, or a component of and instructions to the...
J2ee Ear Structure
Java - Packaging, Archive, Library (JAR, WAR, EAR File)

For deployment purpose, J2EE applications are delivered and reside in Archive files (or unit). A RAR, WAR or EAR file is a standard JAR (.jar) file with a .war or .ear extension. Each archive extension...
Java Conceptuel Diagram
Java Web Application - Mapping URLs to Web Components (context-root, url pattern)

When it receives a request, the web container determine the web component that should handle the request via the URL A URL path contains the context root and, optionally, a URL pattern: The web container...
Java Conceptuel Diagram
JavaServer Faces (JSF)

The request: means to maintain the state for the time of a request session: means to maintain the state for the time of a session (between page views) none: means that the bean will be created but...
Finite Automata Customer Store Bank
Process - LifeCycle (Entity State) (Status)

In a process based model, every entity has a lifecycle (Status) that shows a finite number of distinct states. The status shows the state of an entity ie: finite automata See also: Sequence:...
Web - Application

A web application is a hierarchical set of folders containing scripts that will create: web code for a frontend application or data (json,...) for a backend application These folders are structured...



Share this page:
Follow us:
Task Runner