Change or adding WAR files

 

You can change WAR files on appservers without having to stop the server and start it again. This file describes--

  1. Changing an existing JSP file
  2. Adding a new JSP file to an existing application
  3. Changing an existing servlet class (editing and recompiling)
  4. Changing a dependent class of an existing servlet class
  5. Adding a new servlet using the Invoker (Serve Servlets by class name) facility or adding a dependent class to an existing application
  6. Adding a new servlet, including a new definition of the servlet in the web.xml deployment descriptor for the application
  7. Change the web.xml file of a WAR file
  8. Change the ibm-web-ext.xmi file of a WAR file
  9. Change the ibm-web-bnd.xmi file of a WAR file

 

Change an existing JSP file

Place the changed JSP file directly in the $APP_ROOT/module_name directory or the appropriate subdirectory. The change will be automatically detected and the JSP will be recompiled and reloaded.

Hot deployment Not applicable
Dynamic reloading Yes

 

Adding a new JSP file to an existing application

Place the new JSP file directly in the $APP_ROOT/module_name directory or the appropriate subdirectory. The new file will be automatically detected and compiled on the first request to the page.

Hot deployment Yes
Dynamic reloading Yes

 

Change an existing servlet class (editing and recompiling)

  1. Place the new version of the servlet .class file directly in... $APP_ROOT/module_name/WEB-INF/classes

If the .class file is part of a Jar file, you can place the new version of the Jar file directly in...

$APP_ROOT/module_name/WEB-INF/lib

In either case, the change will be detected, the web application (.war) will be shut down and reinitialized, picking up the new class.

  • If automatic reloading is not enabled, restart the application.

    Use the administrative console to restart the application or run the wasadmin stopApplication and startApplication commands.

    If automatic reloading is enabled, you do not need to take further action. Automatic reloading will detect the change.

    Hot deployment Not applicable
    Dynamic reloading Yes

     

    Change a dependent class of an existing servlet class

    1. Place the new version of the dependent .class file directly in...

      $APP_ROOT/module_name/WEB-INF/classes

      If the .class file is part of a Jar file, you can place the new version of the Jar file directly in...

      $APP_ROOT/module_name/WEB-INF/lib

      In either case, the change will be detected, the web application (.war) will be shut down and reinitialized, picking up the new class.

    2. If automatic reloading is not enabled, restart the application.

      Use the administrative console to restart the application or run the wasadmin stopApplication and startApplication commands.

      If automatic reloading is enabled, you do not need to take further action. Automatic reloading will detect the change.

    Hot deployment Not applicable
    Dynamic reloading Yes

     

    Adding a new servlet using the Invoker (Serve Servlets by class name) facility or adding a dependent class to an existing application

    1. Place the new .class file directly in...

      $APP_ROOT/module_name/WEB-INF/classes

      If the .class file is part of a Jar file, you can place the new version of the Jar file directly in...

      $APP_ROOT/module_name/WEB-INF/lib

      In either case, the change will be detected, the web application (.war) will be shut down and reinitialized, picking up the new class.

      This case is treated the same as changing an existing class. The difference is that adding the servlet or class does not immediately cause the web application (.war) to reload because the class has never been loaded before. The class simply becomes available for execution.

    2. If automatic reloading is not enabled, restart the application.

      Use the administrative console to restart the application or run the wasadmin stopApplication and startApplication commands.

      If automatic reloading is enabled, you do not need to take further action. Automatic reloading will detect the change.

    Hot deployment Yes
    Dynamic reloading Not applicable

     

    Adding a new servlet, including a new definition of the servlet in the web.xml deployment descriptor for the application

    1. Place the new .class file directly in...

      $APP_ROOT/module_name/WEB-INF/classes

      If the ".class" file is part of a Jar file, you can place the new version of the Jar file directly...

      $APP_ROOT/module_name/WEB-INF/lib

      You can edit the web.xml file in place or copy it into...

      $APP_ROOT/module_name/WEB-INF/classes

      The new .class file will not trigger a reloading of the application.

    2. Restart the application.

      Use the administrative console to restart the application or run the wasadmin stopApplication and startApplication commands. After the application restarts, the new servlet is available for service.

    Hot deployment Yes
    Dynamic reloading Not applicable

     

    Change the web.xml file of a WAR file

    1. Edit the web.xml file in place or copy it into...

      $METADATA_ROOT/module_name/WEB-INF

    2. Restart the application. Use the administrative console to restart the application or run the wasadmin stopApplication and startApplication commands.

    Hot deployment Yes
    Dynamic reloading Yes

     

    Change the ibm-web-ext.xmi file of a WAR file

    Edit the extension settings as needed. You can change all of the extension settings. The only warning is if you set the reloadInterval property to zero (0) or the reloadEnabled property to false, the application will no longer automatically detect changes to class files. Both of these changes disable the automatic reloading function. The only way to re-enable automatic reloading is to change the appropriate property and restart the application.

    Hot deployment Not applicable
    Dynamic reloading Yes

     

    Change the ibm-web-bnd.xmi file of a WAR file

    1. Edit the bindings as needed. You can change all of the values but ensure that the entities you are binding to are present in the configuration of the server.

    2. Restart the application. Use the administrative console to restart the application or run the wasadmin stopApplication and startApplication commands.

    Hot deployment Not applicable
    Dynamic reloading Yes

     

    See Also

    Hot deployment and dynamic reloading