The path to the architect 15th day installation and optimization of IBM WebSphere (II.)

Source: Internet
Author: User
Tags xmlns

5.3 In was within the agency applied

Generally we use the ear format to weblogic our Web application in was, so Tomcat is slightly different here from the one in the.

To do this, we made an ant script to package our ear.

The format of an ear file should be as follows:

Myear

|__ Meta-inf

|__application.xml

|__mywar.war

As you can see, an ear file:

Contains a meta-inf directory in which there will be a application.xml file.

Then there will be a. war file in the same place as the Meta-inf directory, which is the Web application of the standard war format.

5.3.1 Application.xml File

<?xml version= "1.0" encoding= "UTF-8"?>
<application xmlns= "Http://java.sun.com/xml/ns/javaee"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" version= "5"
xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" >
<display-name>cbbsEAR</display-name>
<module>
<web>
<web-uri>cbbs.war</web-uri>
<context-root>/cbbs</context-root>
</web>
</module>
</application>

5.3.2 using ant Packaging

In fact, our ant script is simple, and it does the following things:

1 compile our project with IBM's own JDK, the IBM JDK, to ensure that our project can be resolved by our being.

2. Make our project A. War file

<target name= "Makewar" depends= "compile" >

<jar destfile= "${build.dir}/app/${war.name}" basedir= "${build.dir}"/>

</target>

3 Make the. war file and the Application.xml file into an. ear file

<target name= "Makeear" depends= "Makewar" >
<ear destfile= "${build.dir}/${ear.name}" appxml= "${eardescription.file}" >
<fileset dir= "${build.dir}/app" >
<include name= "**/*.war"/>
</fileset>
</ear>
</target>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.