JAR
A JAR (Java Archive) is a package file format typically used to aggregate many Java class files and associated metadata and resources (text, images, etc.) into one file for distribution.
JAR files are archive files that include a Java-specific manifest file. They are built on the ZIP format and typically have a .jar file extension.
Operation | Command |
---|---|
To create a JAR file | jar cf jar-file input-file(s) |
To view the contents of a JAR file | jar tf jar-file |
To extract the contents of a JAR file | jar xf jar-file |
To extract specific files from a JAR file | jar xf jar-file archived-file(s) |
To run an application packaged as a JAR file (requires the Main-class manifest header) | java -jar app.jar |
To invoke an applet packaged as a JAR file | <applet code=AppletClassName.class archive="JarFileName.jar" width=width height=height> </applet> |
WAR or Web Application Archive
A Web Application is a group of server-side resources that create an interactive online application.
Server-side resources include:
- Servlets ( small server-side applications )
- JSPs (dynamic content)
- Static documents (HTML, images)
- Server-side classes
- Client-side applets and beans
Before deploying an application package and registering it with a WLS server.
Follow these steps to package a Web App
- Arrange resources in a prescribed directory structure
- Develop web.xml Deployment Descriptor (or copy as required)
- Develop weblogic.xml Deployment Descriptor (WLS-Specific)
- Archive Web App into .war file using jar command
- Deploy Web App onto Weblogic Application Server
- Configure Web App with WLS Administration Console
The structure of Web Application is defined by the Servlet Specification.
- Define run-time environment
- Map URLs to Servlets and JSPs
- Define application defaults such as welcome and error pages
- Specify J2EE security constraints
- Define work managers for applications
- Set the context-root for the application
web.xml file : The web.xml file is a deployment descriptor for configuring
- 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 file: The weblogic.xml file is a Weblogic server specific deployment descriptor for configuring
- JSP Properties
- JNDI mappings
- Security role mappings
- HTTP session parameters
- Work Managers
- Context root
- Virtual Directory mappings
- Logging parameters
- Library modules
EJB
Enterprise JavaBeans Standardizes development and deployment of Java server components.
The EJB specification defines relationships between:
- The EJB and its container
- The container and the application server
- The container and the client
Types of EJBs
EJB Application Directory Structure:
EAR
An Enterprise Application is a grouping of several resources into one deployable unit packaged in an .ear file.
These resources include:
- Web Applications (.war)
- EJB Applications (.jar)
- Java Applications (.jar)
- Resource Adapters (.rar)
Enterprise Application Directory Structure
- To avoid Name space clashes
- Declare Application-wide security roles
- Deploy an Application as one unit
- Share Application wide EJB resources
- Configure local JDBC data sources
- Configure local JMS resources
- Configure local XML resources
weblogic-application.xml file: This is a deployment descriptor for EAR file use to configure Weblogic Specific features:
- XML parses
- XML entity mappings
- JDBC data sources
- JMS connection factories and destinations
- Security realms
No comments:
Post a Comment