InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.2: JSP support and environment in WebSphere >
4.2.2.2.4: Batch Compiling JSP files >
4.2.2.2.4.1: Compiling JSP .91 files as a batch
4.2.2.2.4.1: Compiling JSP .91 files as a batch
To use the JSP batch compiler for JSP .91 files:
- Add the following JAR files (found in the Application Server lib directory) to your system classpath:
- ibmwebas.jar (contains the batch compiler classes)
- servlet.jar (contains the Java Servlet 2.1 APIs)
- At an operating system command prompt, enter the following command on a single line:
java com.ibm.servlet.jsp.http.pagecompile.jsp.tsx.batch.JspBatch -s sourceRootDir
-t targetRootDir -c classPath -l libDirectory -v
where:
- sourceRootDir
The root directory of the paths where the batch JSP compiler will search JSP source files to process. The compiler processes all files with the extension .jsp that are in the source root and its subdirectories.
- targetRootDir
The root directory of the path where you want the compiler to place the resulting .java and .class files. The non-batch, JSP 0.91 processor (PageCompileServlet) places the .java and .class files in the path:
product_installation_root\temp\servlet_host_name\app_name\pagecompile
where product_installation_root is the path where the Application Server is installed and app_name is the name of the application root folder. It is recommended that you specify that path for the target root if you are batch compiling JSPs to run on your production Application Server. However, if you are batch compiling on a different system and plan to move them to the Application Server later, you can specify any valid target root directory.
If any of the .class files have package names, those names will become the names of subdirectories under the target root. For example, if the .class name is security.login.login.class and the target root is d:\WebSphere\AppServer\temp\default_host\examples\pagecompile, the batch compiler places the .java and .class files in d:\WebSphere\AppServer\temp\default_host\examples\pagecompile\security\login directory.
- classPath
An optional parameter that is the fully-qualified path for the classes and Java archives that the compiled classes need. If those resources are in multiple paths, use the semicolon character (;) to separate the path names. You do not need to specify the Application Server JAR files on this parameter.
- libDirectory
The fully-qualified path to the Application Server ibmwebas.jar (contains the JSP batch compiler and related JSP classes) and servlet.jar (contains the Java Servlet 2.1 APIs). The default path is product_installation_root\lib.
- -v
An optional parameter that causes more trace and progress messages to be displayed.
All of the command parameters, except -v, are required.
Example
Suppose you want to precompile the JSP files associated with the
examples application, one of the two applications installed
with the application server. If the JSP files are in the path:
d:\WebSphere\AppServer\hosts\default_host\examples\web
and you want the compiled files to be placed in:
d:\WebSphere\AppServer\temp\default_host\examples\pagecompile
the command would be (typed on a single line):
java com.ibm.servlet.jsp.http.pagecompile.jsp.tsx.batch.JspBatch
-s d:\WebSphere\AppServer\hosts\default_host\examples\web
-t d:\WebSphere\AppServer\temp\default_host\examples\pagecompile
-c d:\WebSphere\AppServer\hosts\default_host\examples\servlets;d:\devcntr\website
-l d:\WebSphere\AppServer\lib
|
|