Applications Server

来源:互联网 发布:崩坏3rd矩阵buff 编辑:程序博客网 时间:2024/05/14 05:20
 To build the hello1 application, follow these steps:
1. In a terminal window, go to <INSTALL>/j2eetutorial14/examples/
web/hello1/.
2. Run asant build. This target will spawn any necessary compilations and
will copy files to the <INSTALL>/j2eetutorial14/examples/web/
hello1/build/ directory.
To package the application into a WAR named hello1.war using asant, use the
following command:
asant create-war

Deploying with asadmin:
To deploy an unpackaged web module with asadmin, open a terminal window or
command prompt and execute
asadmin deploydir full-path-to-web-module-directory
The build task for the hello1 application creates a build directory (including
web.xml) in the structure of a web module. To deploy hello1 using asadmin
deploydir, execute:
asadmin deploydir --contextroot /hello1
<INSTALL>/j2eetutorial14/examples/web/hello1/build

Deploying with asadmin:
To deploy a WAR with asadmin, open a terminal window or command prompt
and execute
asadmin deploy full-path-to-war-file
Deploying with asant
To deploy a WAR with asant, open a terminal window or command prompt in
the directory where you built and packaged the WAR, and execute
asant deploy-war

Listing Deployed Web Modules
The Application Server provides three ways to view the deployed web modules:
• deploytool
a. Select localhost:4848 from the Servers list.
b. View the Deployed Objects list in the General tab.
• Admin Console
a. Open the URL http://localhost:4848/asadmin in a browser.
b. Expand the nodes Applications→Web Applications.
• asadmin
a. Execute
asadmin list-components


Dynamic Reloading:
copy the changed JSP or class files into the deployment directory for the application
or module. The deployment directory for a web module named
context_root is <J2EE_HOME>/domains/domain1/applications/j2ee-modules/
context_root. The server checks for changes periodically and redeploys
the application, automatically and dynamically, with the changes

To enable dynamic reloading, use the Admin Console:
1. Select the Applications Server node.
2. Select the Advanced tab.
3. Check the Reload Enabled box to enable dynamic reloading.
4. Enter a number of seconds in the Reload Poll Interval field to set the interval
at which applications and modules are checked for code changes and
dynamically reloaded.
5. Click the Save button.
In addition, to load new servlet files or reload deployment descriptor changes,
you must do the following:
1. Create an empty file named .reload at the root of the module:
<J2EE_HOME>/domains/domain1/applications/j2ee-modules/
context_root/.reload
2. Explicitly update the .reload file’s time stamp each time you make these
changes. On UNIX, execute
touch .reload
For JSP pages, changes are reloaded automatically at a frequency set in the
Reload Pool Interval. To disable dynamic reloading of JSP pages, set the reloadinterval
property to -1.
/-------------------------------------------------------------------------------------------/
This capability is useful in a development environment, because it allows code
changes to be tested quickly. Dynamic reloading is not recommended for a production
environment, however, because it may degrade performance. In addition,
whenever a reload is done, the sessions at that time become invalid and the client
must restart the session.