Compiles JSP files.
compilejsp local-args [-webapp WebAppName] [-uriroot directory] [-outputdir directory] [-verbose true|false] [-debug true|false] [-keep true|false] [file1 file2 ...]
<jag_compilejsp [ webapp="WebAppName" ] [ uriroot="directory" ] [ outputdir="directory" ] [ verbose="true|false" ] [ debug="true|false" ] [ keep="true|false" ] [ jspfile=”file” ] />
Option |
Description |
Required |
---|---|---|
local-args |
Arguments to run in local mode. See “Using local mode”. |
Yes |
|
Compiles the JSP files in the specified Web application. Uses the DJC_HOME environment variable to locate the Web application directory. Compiles all JSP files in the Web application unless specific files are specified. You must specify one of the You must specify the |
No |
|
Compiles the specified JSP files in the given directory, which must be specified as a complete path. If no files are specified, compiles all JSP files in the directory and its subdirectories. |
No |
|
The full path of the output directory
for generated Java source and compiled classes. If the work\server\Servlet\WebApp-WAName Where server is the name of your server, and WAName is the name of your Web application. To run the JSPs in EAServer, class files must be in this directory. If you do not specify the |
No |
|
Execute in verbose mode. The default
is |
No |
|
Compile the generated Java files with
debugging information. The default is |
No |
|
Keep the generated Java source files
rather than deleting them. The default is |
No |
file1 file2 ... |
When using the command line, the list of files to compile, with paths specified relative to the Web application root directory, if using the webapp option, or the specified directory, if using the uriroot option. If no files are specified, all files in the specified Web application or directory are compiled. |
No |
|
When using Ant, the file to compile with path relative to the relative to the Web application root directory, if using the webapp option, or the specified directory, if using the uriroot option. If no file is specified, all files in the specified Web application or directory are compiled. |
No |
Return value |
Indicates |
---|---|
0 |
The command ran successfully; the result is true/success. |
2 |
The command did not run successfully; an exception was thrown. |
This command line example compiles the files jsp/file1.jsp and jsp/file2.jsp in the Web application named MyWebApp:
jagtool compilejsp -webapp MyWebApp jsp/file1.jsp jsp/file2.jsp
The output is sent to the EAServer directory:
work/server/Servlet/WebApp-MyWebApp
This command line example recursively compiles all JSPs in the Web application named MyWebApp:
jagtool compilejsp -webapp MyWebApp
The output is sent to the EAServer directory:
$DJC_HOME/work/server/Servlet/WebApp-MyWebApp
Where server is the name of the server to which you are connected.
This command line example compiles file1.jsp in the Web application named MyWebApp:
jagtool compilejsp -webapp MyWebApp -outputdir c:\temp file1.jsp
The output is sent to c:\temp.
This command line example compiles file1.jsp in the directory c:\webapps\MyWebAppDir:
jagtool compilejsp -uriroot c:\webapps\MyWebAppDir file1.jsp
The output is sent to the current directory.
This command line example recursively compiles all JSPs in the directory c:\webapps\MyWebAppDir:
jagtool compilejsp -uriroot c:\webapps\MyWebAppDir -outputdir c:\temp
The output is sent to c:\temp.
This Ant build file example defines a target to compile two JSP files:
<target name="compilejsp_test" > <jag_compilejsp Jspfile="file1.jsp" verbose="false" Uriroot="D:\EAS\Sample\jagtool" /> <jag_compilejsp Jspfile="file2.jsp" verbose="false" Uriroot="D:\EAS\Sample\jagtool" /> </target>
You must run compilejsp in local mode. If you are running jagtool, see “Using local mode”. If you are running jagant, see “Using jagant in local mode”.
To use the compilejsp command in Ant, you must add the location of the xalan.jar and crimson.jar files that are included with EAServer to the Ant CLASSPATH. See “Setting up your environment” for more information.
You can also compile JSPs using the EAServer jspc script. The jspc script invokes jagtool to compile JSPs.
Chapter 4, “Creating JavaServer Pages,” in the EAServer Web Application Programmer’s Guide