Before You Assemble the MVC Application

The MVC application is a standard J2EE architecture based application. As a recap, the following are the components you have developed:

  • Servlets

  • JSPs

  • EJBs

These components use JDBC, JNDI, JTA, and JMS for their functioning.

Of these, servlets and JSPs are included in the category of Web components. HTMLs, JSP tag libraries, and any files related to Web components, including static components, such as JavaScript, images, sounds, multimedia files, text files, and so on, are also included in this category. The deployment descriptor files used in these applications are

  • web.xml This file is an XML encoded file and is defined by the J2EE architecture. Its contents provide information about the contents of the WAR file of the Web components and about how the contents combine to make a single application. This file is placed in the /WEB-INF/ directory. The WEB-INF directory is not available to the client, but rather the contents of the directory are used by the Web application to service clients.

  • weblogic.xml This is a WebLogic-specific file that describes external resources. This file has the security realm mappings, JNDI resources mappings, session parameters, JSP parameters, container parameters, and character set parameters.

EJBs form another category, called Enterprise JavaBeans components. These include stateless session beans, stateful session beans, entity beans, and message-driven beans. The deployment descriptor files used in these applications are

  • ejb-jar.xml Based on a standard DTD defined by Sun Microsystems, this file defines the EJB type and its deployment properties.

  • weblogic-ejb-jar.xml This file contains WebLogic-specific deployment information for an EJB.

  • weblogic-cmp-rdbms-jar-<bean name>.xml This file is to be used specifically in case of container-managed persistence entity beans. Each CMP entity bean has a corresponding weblogic-cmp-rdbms-jar-<bean name>.xml file.

Finally, resource adapters are classified as connector components. Resource adapters have the necessary Java and native components required to interact with the Enterprise information systems. The deployment descriptor for the connector components is ra.xml. WebLogic supports both the EIS vendor's adapters and third-party resource adapters.

The JDBC, JNDI, JTA, and JMS components can be included either in the Web components or EJB components, whenever they are used in any of those components.

An Enterprise J2EE application mainly consists of these components packaged into archive files and the deployment descriptors. Web components are archived into a Web ARchive (WAR) file. This is a JAR file with a .war extension, made using Java's jar utility. Enterprise JavaBeans components are archived into a Java ARchive (JAR) file with the .jar extension, made using Java's jar utility. A Resource Adapter ARchive (RAR) file with a .rar extension is made using the vendor or third-party-specific resource adapter files.

To deploy your application, you need to package these components into a single package. You can do this by packaging them into an Enterprise ARchive (EAR) file (a Java archive file with an .ear extension). The following statement makes it easy to remember the components of an EAR file:


WAR + JAR + RAR + application.xml (inside the META-INF directory)
    + weblogic-application.xml (optional) = EAR

The application.xml file has information regarding the components included in the EAR file to be deployed.

You can also have a WebLogic-specific application file called as the weblogic-application.xml file.



Sams Teach Yourself BEA WebLogic Server 7. 0 in 21 Days
Sams Teach Yourself BEA WebLogic Server 7.0 in 21 Days
ISBN: 0672324334
EAN: 2147483647
Year: 2002
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net