User Commands                                            jspc(1M)

NAME
     jspc - precompiles JSP source files into servlets

SYNOPSIS
     jspc  [options] jsp_files or jspc  [options]-webapp dir

DESCRIPTION
     Use the jspc 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  -compile,  and  one  of  -webinc  and  -webxml
     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.

OPTIONS
     jsp_files               One or more JSP  files  to  be  com-
                             piled.

     -webapp dir             A directory containing a web  appli-
                             cation.  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
                             asadmin deploy.

     -help                   Print a summary of  the  syntax  and
                             options for this command.

     -v                       Enables verbose mode.

     -d dir                  The output directory  for  the  com-
                             piled  JSPs. Package directories are
                             automatically generated based on the
                             directories  containing  the  uncom-
                             piled JSPs. The default directory is
                             the   directory   specified  by  the
                             java.io.tmpdir  property,   or   the
                             current  directory if java.io.tmpdir
                             is not defined.

     -l                      Outputs the name  of  the  JSP  page
                             upon failure.

     -s                      Outputs the name  of  the  JSP  page
                             upon success.

     -p name                 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 org.apache.jsp.

     -c  name                The target class  name  of  the  JSP
                             compiled  first. Subsequent JSPs are
                             unaffected. This  option  is  useful
                             only with the files file specifier.

     -mapped                 Generates separate write() calls for
                             each  HTML  line  and  comments that
                             describe the location of  each  line
                             in  the  JSP  file.  By default, all
                             adjacent write() calls are  combined
                             and  no  location  comments are gen-
                             erated.

     -die[ code]             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.

     -uribase dir            The URI directory to which  compila-
                             tions  are relative. Applies only to
                             JSP files listed in the command, and
                             not  to  JSP  files  specified  with
                             -webapp option. This is the location
                             of  each  JSP  file  relative to the
                             uriroot. If this  cannot  be  deter-
                             mined, the default is /.

     -uriroot dir            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
                             -webapp option. If  this  option  is
                             not  specified,  all  parent  direc-
                             tories of the  first  JSP  page  are
                             searched for a WEB-INF subdirectory.
                             The closest  directory  to  the  JSP
                             page  that  has one is used. If none
                             of the JSP's parent directories have
                             a  WEB-INF  subdirectory, the direc-
                             tory from which jspc is  invoked  is
                             used.

     -compile                Compiles the generated servlets.

     -genclass               Identical to the -compile option.

     -webinc file            Creates partial servlet mappings for
                             the  -webapp  option,  which  can be
                             pasted into a web.xml file.

     -webxml file            Creates an entire web.xml  file  for
                             the -webapp option.

     -ieplugin class_id      Specifies the Java plugin COM  class
                             ID  for  Internet Explorer.  Used by
                             the jsp:plugin tags.

     -classpath path         Override the system  classpath  with
                             the specified classpath.

     -xpoweredBy             Adds an X-Powered-By  HTTP  response
                             header.

     -trimSpaces             Trim spaces in template text between
                             actions and directives.

     -smap                   Generates SMAP information for JSR45
                             debugging.

     -dumpsmap               Dumps  SMAP  information  for  JSR45
                             debugging into a file.

     -validate               Validates  .tld  and  web.xml  files
                             against their schemas and DTDs.

     -compilerSourceVM<releasProvides source  compatibility  with
                             the  specified  JDK  release (in the
                             same way as the  javac  command-line
                             switch -source.  This option is pro-
                             vided  for  backward   compatibility
                             with  older  JDK releases. For exam-
                             ple, if  a  JSP  page  declares  the
                             scriptlet         variable        <%
                             java.util.Enumeration enum; %>.  The
                             value  for release must be 1.3, 1.4,
                             1.5 or 5. This is in order  for  the
                             generated  servlet  to  compile suc-
                             cessfully, because enum  has been  a
                             reserved keyword since JDK 1.5.

     -compilerTargetVM<releasGenerates class files for the speci-
                             fied  VM  version. This option works
                             the same way as  javac  command-line
                             switch   -target.   The   value  for
                             release must be one of  the  follow-
                             ing:  1.1,  1.2, 1.3, 1.4, 1.5, 1.6,
                             5, or 6.

EXAMPLES
     Example 1: Using jspc to compile the JSPs in a Web  applica-
     tion

     The following command compiles a set of JSP files into  Java
     source files under /home/user/Hellodir:

     jspc     welcome.jsp      shop.jsp      checkout.jsp      -d
     /home/user/Hellodir

     The following command compiles all  the  JSP  files  in  the
     specified webapp into class files under /home/user/Hellodir:

     jspc   -webapp   /path_to_source_directory    -compile    -d
     /home/user/Hellodir

     The following command compiles a set of JSP files into  Java
     class  files  in  /home/user/Hellodir  with the package name
     com.test.jsp prepended to the  package  hierarchy  found  in
     /path_to_source_directory.  It creates web.xml in the output
     directory.

     jspc  -webapp  /path_to_source_directory  -compile   -webxml
     /home/user/Hellodir/web.xml    -d   /home/user/Hellodir   -p
     com.test.jsp

     To use these precompiled JSP pages in your web  application,
     package    the   servlet   class   files   generated   under
     /home/user/Hellodir into a JAR  file,  place  the  JAR  file
     under     WEB-INF/lib,     and     copy     the    generated
     /home/user/Hellodir/web.xml to WEB-INF/web.xml.

SEE ALSO
     asadmin(1M)
