Recompile any modified classes.
If you have deployed a packaged web module, update any modified components in the WAR.
Redeploy the module.
Reload the URL in the client.
First, change the greeting in the file tut-install/javaeetutorial5/examples/web/hello1/web/index.jsp to
<h2>Hi, my name is Duke. What’s yours?</h2>
To update the project in NetBeans IDE:
Right-click on the project and select Build.
Right-click on the project and select Undeploy and Deploy.
To update the project using the Ant build tool:
Type ant to copy the modified JSP page into the build directory.
Type ant deploy to deploy the WAR file.
To view the modified module, reload the URL in the browser.
You should see the screen in Figure 3–6 in the browser.
If dynamic reloading is enabled, you do not have to redeploy an application or module when you change its code or deployment descriptors. All you have to do is 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 domain-dir/applications/j2ee-modules/context-root. The server checks for changes periodically and redeploys the application, automatically and dynamically, with the changes.
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.
To enable dynamic reloading, use the Admin Console:
Select the Applications Server node.
Select the Advanced tab.
Check the Reload Enabled box to enable dynamic reloading.
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.
Click the Save button.
In addition, to load new servlet files or reload deployment descriptor changes, you must do the following:
Create an empty file named .reload at the root of the module:
Explicitly update the .reload file’s time stamp each time you make these changes. On UNIX, execute