If a JSP is updated, the update is detected when JSP is recompiled or through the monitoring of the class files and the JSP is reloaded. The JSP reloading methods are as follows:
- Reloading by re-compiling JSPs
The Web container checks whether the loaded JSP files, tag files, or the files on which the JSP or tag files depend are updated, and if the date and time of update is different from the loading time, the Web container recompiles and reloads the JSPs.
After an update is detected and the interval for detecting the update of the JSP configuration files lapses, the files are re-compiled. When compilation is complete and when the Web container detects that there are no more requests being processed, the reload processing starts.
- Reloading by monitoring the class files
The Web container checks whether the class files generated from the JSP files loaded in the Web container are updated, and if the date and time of update is different from the loading time, the Web container reloads the JSPs.
After an update is detected and the interval for updating the JSP configuration file lapses, the reload processing starts when the Web container detects that there are no more requests being processed.
The class files are updated in one of the following cases:
- When the JSP pre-compile command is executed and the class files are generated by compiling the JSP files
- When the class files compiled by the JSP pre-compile functionality are copied and over-written in the JSP working directory
For details on the JSP pre-compile functionality, see 2.5 JSP pre-compile functionality and the storage of the compilation results in the uCosminexus Application Server Web Container Functionality Guide.
The following table describes the differences between the JSP reloading methods.
Table 13-16 Differences between the JSP reloading methods
Items | For reloading by re-compiling JSPs | For reloading by monitoring the class files |
---|
Usage of the JSP pre-compile functionality | The JSP pre-compile functionality is disabled. | The JSP pre-compile functionality is enabled. |
Target files for update detection# | - JSP files
- Tag files
- Files on which the JSP files or tag files depend
| - Class files generated by the JSP pre-compile functionality
|
Processing after the update detection | The files are compiled and reloaded. | The class files are reloaded. |
#: The updates are not detected even if you update the files that are not loaded into the Web container or the files for which updates are not to be detected.
In both the reloading methods, you can specify the update detection interval for JSPs and the interval for updating the JSP configuration file to detect the file updates. For details on the update detection interval, see 13.8.6 Update detection interval for J2EE applications. For details on the interval for configuration file update, see 13.8.7 Interval for updating the J2EE application configuration file.
- Note
- Time at which the loaded JSPs are destroyed and the monitoring targets of the JSP reloading functionality
- If you execute the Web application reloading functionality when the Web application reloading functionality is used together with the JSP reloading functionality, the loaded JSPs are destroyed. Only the JSP files, loaded when the Web application reloading functionality is executed, are monitored for the JSP reloading functionality.
- When you restart the Web container and Web applications, the loaded JSPs are destroyed. Also, only the JSP files loaded after the Web application starts are monitored for the JSP reloading functionality.