<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
<!--ArborText, Inc., 1988-1999, v.4002-->
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY metainfo SYSTEM "metainfo.sgm">
<!ENTITY Date "22 Dec 2004">
<!ENTITY SectDesc "User Commands">
<!ENTITY Software "J2EE SDK 1.4">
<!ENTITY arch "generic">
<!ENTITY copyright "Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved">
<!ENTITY % commonents SYSTEM "smancommon.ent">
%commonents;
<!ENTITY % booktitles SYSTEM "booktitles.ent">
%booktitles;
]>
<?Pub UDT _bookmark _target>
<?Pub Inc>
<refentry id="jspc-1m">
<refmeta><refentrytitle>jspc</refentrytitle><manvolnum>1M</manvolnum>&metainfo;
</refmeta>
<refnamediv><indexterm><primary sortas="jspc ">jspc &mdash; precompiles JSP
source files into servlets</primary></indexterm><indexterm><primary sortas="precompiles JSP source files into servlets">
precompiles JSP source files into servlets &mdash; jspc</primary></indexterm>
<refname>jspc</refname><refpurpose>precompiles JSP source files into servlets
</refpurpose></refnamediv>
<refsynopsisdiv><title>&synp-tt;</title>
<cmdsynopsis><command>jspc </command><arg><replaceable>options</replaceable></arg>
<command><replaceable> jsp_files</replaceable></command><command> or </command>
<command>jspc </command><arg><replaceable>options</replaceable></arg><command><option>
webapp </option><replaceable>dir</replaceable></command>
</cmdsynopsis></refsynopsisdiv>
<refsect1><title>&desc-tt;</title>
<para>Use the <command>jspc</command> command to compile your JSP 2.1 compliant
source files into servlets. To allow the Application Server to pick up the
precompiled JSP pages from a JAR file, specify the <option>compile</option>,
and one of <option>webinc</option> and <option>webxml</option> options, which
cause the JSP pages to be mapped to their corresponding servlet class files.
This means that the JSP compiler will be bypassed when those JSPs are accessed.
</para>
</refsect1>
<refsect1><title>&opts-tt;</title>
<variablelist termlength="medium">
<varlistentry><term><replaceable>jsp_files</replaceable></term><listitem>
<para>One or more JSP files to be compiled.</para>
</listitem></varlistentry>
<varlistentry><term><option>webapp </option><replaceable>dir</replaceable></term>
<listitem><para>A directory containing a web application. All JSPs in the
directory and its subdirectories are compiled. You cannot specify a WAR, JAR,
or ZIP file; you must first deploy it to an open directory structure using <command>
asadmin deploy</command>.</para>
</listitem></varlistentry>
<varlistentry><term><option>help</option></term><listitem><para>Print a summary
of the syntax and options for this command.</para>
</listitem></varlistentry>
<varlistentry><term><option>v</option></term><listitem><para> Enables verbose
mode.</para>
</listitem></varlistentry>
<varlistentry><term><option>d <replaceable>dir</replaceable> </option></term>
<listitem><para>The output directory for the compiled JSPs. Package directories
are automatically generated based on the directories containing the uncompiled
JSPs. The default directory is the directory specified by the <literal>java.io.tmpdir
</literal> property, or the current directory if <literal>java.io.tmpdir</literal>
is not defined.</para>
</listitem></varlistentry>
<varlistentry><term><option>l</option></term><listitem><para>Outputs the name
of the JSP page upon failure.</para>
</listitem></varlistentry>
<varlistentry><term><option>s</option></term><listitem><para>Outputs the name
of the JSP page upon success.</para>
</listitem></varlistentry>
<varlistentry><term><option>p<replaceable> name</replaceable> </option></term>
<listitem><para>The name of the target package for all specified JSPs, which
is prepended to the package component derived from the directory in which
the JSP pages are located. The default is <literal>org.apache.jsp</literal>.
</para>
</listitem></varlistentry>
<varlistentry><term><option>c <replaceable> name</replaceable> </option></term>
<listitem><para>The target class name of the JSP compiled first. Subsequent
JSPs are unaffected. This option is useful only with the <replaceable>files
</replaceable> file specifier.</para>
</listitem></varlistentry>
<varlistentry><term><option>mapped</option></term><listitem><para>Generates
separate <literal>write()</literal> calls for each HTML line and comments
that describe the location of each line in the JSP file. By default, all adjacent <literal>
write()</literal> calls are combined and no location comments are generated.
</para>
</listitem></varlistentry>
<varlistentry><term><option>die</option><optional><replaceable> code</replaceable></optional></term>
<listitem><para>Causes the JVM to exit and generates an error return code
if a fatal error occurs. If the code is absent or unparsable it defaults to
1.</para>
</listitem></varlistentry>
<varlistentry><term><option>uribase <replaceable>dir</replaceable></option></term>
<listitem><para>The URI directory to which compilations are relative. Applies
only to JSP files listed in the command, and not to JSP files specified with <option>
webapp</option> option. This is the location of each JSP file relative to
the <filename>uriroot</filename>. If this cannot be determined, the default
is <literal>/</literal>.</para>
</listitem></varlistentry>
<varlistentry><term><option>uriroot <replaceable>dir</replaceable></option></term>
<listitem><para>The root directory against which URI files are resolved. Applies
only to JSP files listed in the command, and not to JSP files specified with <option>
webapp</option> option. If this option is not specified, all parent directories
of the first JSP page are searched for a <filename>WEB-INF</filename> subdirectory.
The closest directory to the JSP page that has one is used. If none of the
JSP's parent directories have a <filename>WEB-INF</filename> subdirectory,
the directory from which <command>jspc</command> is invoked is used.</para>
</listitem></varlistentry>
<varlistentry><term><option>compile</option></term><listitem><para>Compiles
the generated servlets.</para>
</listitem></varlistentry>
<varlistentry><term><option>genclass</option></term><listitem><para>Identical
to the <option>compile</option> option.</para>
</listitem></varlistentry>
<varlistentry><term><option>webinc </option><replaceable>file</replaceable></term>
<listitem><para>Creates partial servlet mappings for the <option>webapp</option>
option, which can be pasted into a <filename>web.xml</filename> file.</para>
</listitem></varlistentry>
<varlistentry><term><option>webxml </option><replaceable>file</replaceable></term>
<listitem><para>Creates an entire <filename>web.xml</filename> file for the <option>
webapp</option> option.</para>
</listitem></varlistentry>
<varlistentry><term><option>ieplugin </option><replaceable>class_id</replaceable></term>
<listitem><para>Specifies the Java plugin COM class ID for Internet Explorer.
Used by the <filename>jsp:plugin</filename> tags.</para>
</listitem></varlistentry>
<varlistentry><term><option>classpath</option> <replaceable>path</replaceable></term>
<listitem><para>Override the system classpath with the specified classpath.
</para>
</listitem></varlistentry>
<varlistentry><term><option>xpoweredBy</option></term><listitem><para>Adds
an <literal>X-Powered-By</literal> HTTP response header.</para>
</listitem></varlistentry>
<varlistentry><term><option>trimSpaces</option></term><listitem><para>Trim
spaces in template text between actions and directives.</para>
</listitem></varlistentry>
<varlistentry><term><option>smap</option></term><listitem><para>Generates
SMAP information for JSR45 debugging.</para>
</listitem></varlistentry>
<varlistentry><term><option>dumpsmap</option></term><listitem><para>Dumps
SMAP information for JSR45 debugging into a file.</para>
</listitem></varlistentry>
<varlistentry><term><option>validate</option></term><listitem><para>Validates <filename>
.tld</filename> and <filename>web.xml</filename> files against their schemas
and DTDs.</para>
</listitem></varlistentry>
<varlistentry><term><option>compilerSourceVM&lt;release></option></term><listitem>
<para>Provides source compatibility with the specified JDK release (in the
same way as the javac command-line switch <command>-source</command>.  This
option is provided for backward compatibility with older JDK releases. For
example, if a JSP page declares the scriptlet variable <command>&lt;% java.util.Enumeration
enum; %></command>. The value for release must be 1.3, 1.4, 1.5 or 5. This
is in order for the generated servlet to compile successfully, because <command>
enum</command>  has been a reserved keyword since JDK 1.5.</para>
</listitem></varlistentry>
<varlistentry><term><option>compilerTargetVM&lt;release></option></term><listitem>
<para>Generates class files for the specified VM version. This option works
the same way as javac command-line switch <command>-target</command>. The
value for release must be one of the following: 1.1, 1.2, 1.3, 1.4, 1.5, 1.6,
5, or 6.</para>
</listitem></varlistentry>
</variablelist></refsect1>
<refsect1><title>&exam-tt;</title>
<example>
<title>Using jspc to compile the <?Pub Caret>JSPs in a Web application</title>
<para>The following command compiles a set of JSP files into Java source files
under <filename>/home/user/Hellodir</filename>:</para>
<para><userinput>jspc welcome.jsp shop.jsp checkout.jsp -d /home/user/Hellodir
</userinput></para>
<para>The following command compiles all the JSP files in the specified webapp
into class files under <filename>/home/user/Hellodir</filename>:</para>
<para><userinput>jspc &mdash;webapp /path_to_source_directory &mdash;compile &mdash;d
/home/user/Hellodir </userinput></para>
<para>The following command compiles a set of JSP files into Java class files
in <filename>/home/user/Hellodir</filename> with the package name <literal>
com.test.jsp</literal> prepended to the package hierarchy found in <filename>
/path_to_source_directory</filename>. It creates <filename>web.xml</filename>
in the output directory.</para>
<para><userinput>jspc &mdash;webapp /path_to_source_directory &ndash;compile &ndash;webxml
/home/user/Hellodir/web.xml &mdash;d /home/user/Hellodir &mdash;p com.test.jsp
</userinput></para>
<para>To use these precompiled JSP pages in your web application, package
the servlet class files generated under <filename>/home/user/Hellodir</filename>
into a JAR file, place the JAR file under <filename>WEB-INF/lib</filename>,
and copy the generated <filename>/home/user/Hellodir/web.xml</filename> to <filename>
WEB-INF/web.xml</filename>.</para>
</example>
</refsect1>
<refsect1><title>&also-tt;</title>
<para><link linkend="asadmin-1m"><citerefentry><refentrytitle>asadmin</refentrytitle>
<manvolnum>1M</manvolnum></citerefentry></link></para>
</refsect1>
</refentry>
<?Pub *0000010942>
