Change or add WAR files

You can change WAR files on application servers without having to stop the server and start it again. You can perform any of these updates while the application server is running:

Note: The variable application_root represents the directory that contains the expanded application files. See step 1 on Use hot deployment and dynamic reloading for information about the location of the metadata files.

Change an existing JSP file

  1. Change the JSP file.
  2. Place the updated JSP file in the application_root/module_name directory or the appropriate subdirectory. The change is automatically detected, and the JSP is recompiled and reloaded.

Add a new JSP file to an existing application

Place the new JSP file in the application_root/module_name directory or the appropriate subdirectory. The new file is detected automatically and compiled when the next request to the page is received.

Change an existing servlet class (editing and recompiling)

  1. Place the new version of the servlet .class file in the application_root/module_name/WEB-INF/classes directory. If the .class file is part of a JAR file, you can place the new version of the JAR file in the application_root/module_name/WEB-INF/lib directory. In either case, the change is detected automatically. The Web application is shut down and reinitialized, and picks up the new class.
  2. Update the application.

Change a dependent class of an existing servlet class

  1. Place the new version of the dependent .class file in the application_root/module_name/WEB-INF/classes directory. If the .class file is part of a JAR file, you can place the new version of the JAR file in the application_root/module_name/WEB-INF/lib directory. In either case, the change is detected automatically. The Web application is shut down and reinitialized, and picks up the new class.
  2. Update the application.

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

  1. Place the new .class file in the application_root/module_name/WEB-INF/classes directory. If the .class file is part of a JAR file, you can place the new version of the JAR file in the application_root/module_name/WEB-INF/lib directory. In either case, the change is detected automatically. The Web application is shut down and reinitialized, and picks up the new class.

    Note: Adding a new class is similar to updating an existing class. However,the Web application does not need to reload since the class has never been loaded before. The class is immediately available to the application.

  2. Update the application.

Add 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 in the application_root/module_name/WEB-INF/classes directory. If the .class file is part of a JAR file, you can place the new version of the JAR file in the application_root/module_name/WEB-INF/lib directory. Automatic reloading does not detect the new .class file.
  2. Edit the web.xml file in the application_root/module_name/WEB-INF/classes directory.
  3. Use the administrative console or wsadmin to stop and restart the application. After you restart the application, the new servlet is available to the applications.

Change the web.xml file of a WAR file

  1. Edit the web.xml file in the metadata_root/module_name/WEB-INF directory.

    Note: The variable metadata_root represents the location of the metadata files for the specified application or module. See step 2 on Use hot deployment and dynamic reloading for information about the location of the metadata files.

  2. Use the administrative console or wsadmin to stop and restart the application.

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

  1. Edit the extension settings.
  2. Use the administrative console or wsadmin to stop and restart the application.

Note: If you set the reloadInterval property to zero (0) or the reloadEnabled property to false, automatic reloading is disabled, and the application does not automatically detect changes to class files. To re-enable automatic reloading, you must change the appropriate property and restart the application.

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

  1. Edit the bindings as needed. Ensure that you are binding to entities that are present in the configuration of the server.
  2. Use the administrative console or wsadmin to stop and restart the application.