Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » jasper » [javadoc | source]
org.apache.jasper
public class: JspC [javadoc | source]
java.lang.Object
   org.apache.jasper.JspC

All Implemented Interfaces:
    Options

Shell for the jspc compiler. Handles all options associated with the command line and creates compilation contexts which it then compiles according to the specified options. This version can process files from a _single_ webapp at once, i.e. a single docbase can be specified. It can be used as an Ant task using:
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath>
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${ENV.CATALINA_HOME}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${ENV.CATALINA_HOME}/common/lib">
<include name="*.jar"/>
</fileset>
<path refid="myjars"/>
</classpath>
</taskdef>

<jasper2 verbose="0"
package="my.package"
uriroot="${webapps.dir}/${webapp.name}"
webXmlFragment="${build.dir}/generated_web.xml"
outputDir="${webapp.dir}/${webapp.name}/WEB-INF/src/my/package" />
Field Summary
public static final  String DEFAULT_IE_CLASS_ID     
protected static  Log log     
protected static final  String SWITCH_VERBOSE     
protected static final  String SWITCH_HELP     
protected static final  String SWITCH_OUTPUT_DIR     
protected static final  String SWITCH_PACKAGE_NAME     
protected static final  String SWITCH_CACHE     
protected static final  String SWITCH_CLASS_NAME     
protected static final  String SWITCH_FULL_STOP     
protected static final  String SWITCH_COMPILE     
protected static final  String SWITCH_SOURCE     
protected static final  String SWITCH_TARGET     
protected static final  String SWITCH_URI_BASE     
protected static final  String SWITCH_URI_ROOT     
protected static final  String SWITCH_FILE_WEBAPP     
protected static final  String SWITCH_WEBAPP_INC     
protected static final  String SWITCH_WEBAPP_XML     
protected static final  String SWITCH_MAPPED     
protected static final  String SWITCH_XPOWERED_BY     
protected static final  String SWITCH_TRIM_SPACES     
protected static final  String SWITCH_CLASSPATH     
protected static final  String SWITCH_DIE     
protected static final  String SWITCH_POOLING     
protected static final  String SWITCH_ENCODING     
protected static final  String SWITCH_SMAP     
protected static final  String SWITCH_DUMP_SMAP     
protected static final  String SHOW_SUCCESS     
protected static final  String LIST_ERRORS     
protected static final  int INC_WEBXML     
protected static final  int ALL_WEBXML     
protected static final  int DEFAULT_DIE_LEVEL     
protected static final  int NO_DIE_LEVEL     
protected static final  String[] insertBefore     
protected static  int die     
protected  String classPath     
protected  URLClassLoader loader     
protected  boolean trimSpaces     
protected  boolean genStringAsCharArray     
protected  boolean xpoweredBy     
protected  boolean mappedFile     
protected  boolean poolingEnabled     
protected  File scratchDir     
protected  String ieClassId     
protected  String targetPackage     
protected  String targetClassName     
protected  String uriBase     
protected  String uriRoot     
protected  Project project     
protected  int dieLevel     
protected  boolean helpNeeded     
protected  boolean compile     
protected  boolean smapSuppressed     
protected  boolean smapDumped     
protected  boolean caching     
protected  Map cache     
protected  String compiler     
protected  String compilerTargetVM     
protected  String compilerSourceVM     
protected  boolean classDebugInfo     
protected  boolean failOnError    Throw an exception if there's a compilation error, or swallow it. Default is true to preserve old behavior. 
protected  List extensions    The file extensions to be handled as JSP files. Default list is .jsp and .jspx. 
protected  List pages    The pages. 
protected  boolean errorOnUseBeanInvalidClassAttribute    Needs better documentation, this data member does. True by default. 
protected  String javaEncoding    The java file encoding. Default is UTF-8. Added per bugzilla 19622. 
protected  String webxmlFile     
protected  int webxmlLevel     
protected  boolean addWebXmlMappings     
protected  Writer mapout     
protected  CharArrayWriter servletout     
protected  CharArrayWriter mappingout     
protected  JspCServletContext context    The servlet context. 
protected  JspRuntimeContext rctxt    The runtime context. Maintain a dummy JspRuntimeContext for compiling tag files. 
protected  TldLocationsCache tldLocationsCache    Cache for the TLD locations 
protected  JspConfig jspConfig     
protected  TagPluginManager tagPluginManager     
protected  boolean verbose     
protected  boolean listErrors     
protected  boolean showSuccess     
protected  int argPos     
protected  boolean fullstop     
protected  String[] args     
Method from org.apache.jasper.JspC Summary:
addExtension,   completeWebXml,   execute,   genStringAsCharArray,   generateWebMapping,   getCache,   getCheckInterval,   getClassDebugInfo,   getClassPath,   getCompiler,   getCompilerClassName,   getCompilerSourceVM,   getCompilerTargetVM,   getDevelopment,   getDisplaySourceFragment,   getErrorOnUseBeanInvalidClassAttribute,   getExtensions,   getFailOnError,   getFork,   getIeClassId,   getJavaEncoding,   getJspCompilerPath,   getJspCompilerPlugin,   getJspConfig,   getKeepGenerated,   getMappedFile,   getModificationTestInterval,   getProject,   getProtectionDomain,   getScratchDir,   getSendErrorToClient,   getTagPluginManager,   getTagPoolSize,   getTldLocationsCache,   getTrimSpaces,   initClassLoader,   initServletContext,   initWebXml,   isCaching,   isPoolingEnabled,   isSmapDumped,   isSmapSuppressed,   isXpoweredBy,   locateUriRoot,   main,   mergeIntoWebXml,   nextArg,   nextFile,   processFile,   resolveFile,   scanFiles,   setAddWebXmlMappings,   setArgs,   setCaching,   setClassDebugInfo,   setClassName,   setClassPath,   setCompile,   setCompiler,   setCompilerSourceVM,   setCompilerTargetVM,   setErrorOnUseBeanInvalidClassAttribute,   setFailOnError,   setGenStringAsCharArray,   setIeClassId,   setJavaEncoding,   setJspFiles,   setListErrors,   setOutputDir,   setPackage,   setPoolingEnabled,   setProject,   setSmapDumped,   setSmapSuppressed,   setTrimSpaces,   setUriroot,   setValidateXml,   setVerbose,   setWebXml,   setWebXmlFragment,   setXpoweredBy
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jasper.JspC Detail:
 protected  void addExtension(String extension) 
    Adds the given file extension to the list of extensions handled as JSP files.
 protected  void completeWebXml() 
 public  void execute() throws JasperException 
    Executes the compilation.
 public boolean genStringAsCharArray() 
    Indicates whether text strings are to be generated as char arrays.
 public  void generateWebMapping(String file,
    JspCompilationContext clctxt) throws IOException 
 public Map getCache() 
 public int getCheckInterval() 
    Background compilation check intervals in seconds
 public boolean getClassDebugInfo() 
 public String getClassPath() 
 public String getCompiler() 
    Compiler to use.
 public String getCompilerClassName() 
    Compiler class name to use.
 public String getCompilerSourceVM() 
 public String getCompilerTargetVM() 
 public boolean getDevelopment() 
    Is Jasper being used in development mode?
 public boolean getDisplaySourceFragment() 
 public boolean getErrorOnUseBeanInvalidClassAttribute() 
 public List getExtensions() 
    Returns the list of file extensions that are treated as JSP files.
 public boolean getFailOnError() 
 public boolean getFork() 
 public String getIeClassId() 
    Gets the class-id value that is sent to Internet Explorer when using tags.
 public String getJavaEncoding() 
    Returns the encoding to use for java files. The default is UTF-8.
 public String getJspCompilerPath() 
 public Class getJspCompilerPlugin() 
 public JspConfig getJspConfig() 
    Obtain JSP configuration informantion specified in web.xml.
 public boolean getKeepGenerated() 
 public boolean getMappedFile() 
    Are we supporting HTML mapped servlets?
 public int getModificationTestInterval() 
    Modification test interval.
 public Project getProject() 
    Returns the project: may be null if not running inside an Ant project.
 public Object getProtectionDomain() 
 public File getScratchDir() 
 public boolean getSendErrorToClient() 
Deprecated!
 public TagPluginManager getTagPluginManager() 
 public int getTagPoolSize() 
 public TldLocationsCache getTldLocationsCache() 
 public boolean getTrimSpaces() 
 protected  void initClassLoader(JspCompilationContext clctxt) throws IOException 
    Initializes the classloader as/if needed for the given compilation context.
 protected  void initServletContext() 
 protected  void initWebXml() 
 public boolean isCaching() 
 public boolean isPoolingEnabled() 
 public boolean isSmapDumped() 
    Should SMAP info for JSR45 debugging be dumped to a file?
 public boolean isSmapSuppressed() 
    Is the generation of SMAP info for JSR45 debuggin suppressed?
 public boolean isXpoweredBy() 
 protected  void locateUriRoot(File f) 
    Find the WEB-INF dir by looking up in the directory tree. This is used if no explicit docbase is set, but only files. XXX Maybe we should require the docbase.
 public static  void main(String[] arg) 
 protected  void mergeIntoWebXml() throws IOException 
    Include the generated web.xml inside the webapp's web.xml.
 protected String nextArg() 
 protected String nextFile() 
 protected  void processFile(String file) throws JasperException 
 protected File resolveFile(String s) 
    Resolves the relative or absolute pathname correctly in both Ant and command-line situations. If Ant launched us, we should use the basedir of the current project to resolve relative paths. See Bugzilla 35571.
 public  void scanFiles(File base) throws JasperException 
    Locate all jsp files in the webapp. Used if no explicit jsps are specified.
 public  void setAddWebXmlMappings(boolean b) 
 public  void setArgs(String[] arg) throws JasperException 
 public  void setCaching(boolean caching) 
 public  void setClassDebugInfo(boolean b) 
 public  void setClassName(String p) 
    Class name of the generated file ( without package ). Can only be used if a single file is converted. XXX Do we need this feature ?
 public  void setClassPath(String s) 
 public  void setCompile(boolean b) 
    Sets the compile flag.
 public  void setCompiler(String c) 
 public  void setCompilerSourceVM(String vm) 
 public  void setCompilerTargetVM(String vm) 
 public  void setErrorOnUseBeanInvalidClassAttribute(boolean b) 
 public  void setFailOnError(boolean b) 
    Set the option that throws an exception in case of a compilation error.
 public  void setGenStringAsCharArray(boolean genStringAsCharArray) 
    Determines whether text strings are to be generated as char arrays, which improves performance in some cases.
 public  void setIeClassId(String ieClassId) 
    Sets the class-id value to be sent to Internet Explorer when using tags.
 public  void setJavaEncoding(String encodingName) 
    Sets the encoding to use for java files.
 public  void setJspFiles(String jspFiles) 
    Parses comma-separated list of JSP files to be processed. If the argument is null, nothing is done.

    Each file is interpreted relative to uriroot, unless it is absolute, in which case it must start with uriroot.

 public  void setListErrors(boolean b) 
 public  void setOutputDir(String s) 
 public  void setPackage(String p) 
 public  void setPoolingEnabled(boolean poolingEnabled) 
 public  void setProject(Project theProject) 
    Sets the project.
 public  void setSmapDumped(boolean smapDumped) 
    Set smapSuppressed flag.
 public  void setSmapSuppressed(boolean smapSuppressed) 
    Set smapSuppressed flag.
 public  void setTrimSpaces(boolean ts) 
 public  void setUriroot(String s) 
    Base dir for the webapp. Used to generate class names and resolve includes
 public  void setValidateXml(boolean b) 
 public  void setVerbose(int level) 
    Sets the verbosity level. The actual number doesn't matter: if it's greater than zero, the verbose flag will be true.
 public  void setWebXml(String s) 
    File where we generate a complete web.xml with the class definitions.
 public  void setWebXmlFragment(String s) 
    File where we generate a web.xml fragment with the class definitions.
 public  void setXpoweredBy(boolean xpoweredBy)