Pre-touch tool for compiling and loading JSP files
When enabled, the pre-touch mechanism causes all JavaServer Pages (JSP) files to be compiled within the web module for which they are configured. We can also configure some or all JSP files to be class loaded and JIT-compiled.
To enable the pre-touch mechanism, use Rational Application Developer to specify the following JSP attributes, which are Assembly Property Extensions for our web module:
- prepareJSPs (Required)
When this attribute is present, all JSP files are compiled at application server startup. This activity runs in a separate thread, allowing the application server to finish other startup actions in parallel. The numeric attribute value represents the minimum size in kilobytes that a JSP file must be in order to also be class loaded and JIT-compiled. The default is 0, which causes all JSP files to be class loaded and JIT-compiled.
JSP file compilation is different from JIT compilation. JSP compilation generates bytecodes, whereas JIT translates the bytecodes into machine code at run time.
- prepareJSPAttribute (Optional)
The pre-touch mechanism compiles and JIT-compiles JSP files by directly invoking the JSP service method, thus making the JSP file susceptible to incurring exceptions because it is called out of context. Such exceptions are avoided by immediately checking the value of this attribute, causing a quick exit from the service method when the JSP was prepared by this tool. This attribute value is added as a request parameter and is composed of alphanumeric characters that your JSP files do not expect to use during normal initiation.
- prepareJSPThreadCount (Optional)
Set this numeric attribute to the number of threads that we would like this mechanism to start up to compile your JSP files. Since a thread makes use of just one processor, multi-processor systems may better utilize this pre-touch mechanism by specifying a value greater than 1. The default setting for this attribute is 1, representing the number of threads created to perform pre-touch processing for this web module.
- prepareJSPClassload (Optional)
Set this attribute to either a whole number or the word changed. By entering changed, only those JSP filess that have been updated or not previously touched, for example, those JSP files to be converted from a .jsp file to a .java file, are class loaded. By entering a numerical value, for example, 1000, the pre-touch tool starts class loading at the 1000th JSP that it processes and all subsequent JSP files. This is convenient in the event that the application server is stopped when starting the pre-touch tool. We can then check the server logs to see how many JSP files have been processed and update the prepareJSPClassload value accordingly to avoid duplicating work. If a JSP file is not class loaded, it cannot be JIT compiled. As a result, if a JSP file does not satisfy the requirements of the prepareJSPClassload attribute, but satisfies the requirements of the prepareJSPs attribute, the JSP file is compiled if it has been updated, but is not class loaded or JIT compiled.
Related:
JSP batch compilation Batch compiler class path JavaServer Pages JSPBatchCompiler command Batch compiler ant task Web applications: Resources for learning