org.apache.jasper
public class JspC extends Task implements Options
<taskdef classname="org.apache.jasper.JspC" name="jasper" > <classpath> <pathelement location="${java.home}/../lib/tools.jar"/> <fileset dir="${ENV.CATALINA_HOME}/lib"> <include name="*.jar"/> </fileset> <path refid="myjars"/> </classpath> </taskdef> <jasper 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 | |
---|---|
protected static int | ALL_WEBXML |
protected boolean | addWebXmlMappings |
protected int | argPos |
protected String[] | args |
protected boolean | blockExternal |
protected Map | cache |
protected boolean | caching |
protected boolean | classDebugInfo |
protected String | classPath |
protected boolean | compile |
protected String | compiler |
protected String | compilerSourceVM |
protected String | compilerTargetVM |
protected JspCServletContext | context
The servlet context. |
protected static int | die |
protected int | dieLevel |
protected static int | DEFAULT_DIE_LEVEL |
static String | DEFAULT_IE_CLASS_ID |
protected boolean | errorOnUseBeanInvalidClassAttribute
Needs better documentation, this data member does.
|
protected List | extensions
The file extensions to be handled as JSP files.
|
protected boolean | failOnError
Throw an exception if there's a compilation error, or swallow it.
|
protected boolean | fullstop |
protected boolean | genStringAsCharArray |
protected boolean | helpNeeded |
protected String | ieClassId |
protected static String[] | insertBefore |
protected static int | INC_WEBXML |
protected String | javaEncoding
The java file encoding. |
protected JspConfig | jspConfig |
protected boolean | listErrors |
protected URLClassLoader | loader |
protected static Log | log |
protected static String | LIST_ERRORS |
protected Writer | mapout |
protected boolean | mappedFile |
protected CharArrayWriter | mappingout |
protected static int | NO_DIE_LEVEL |
protected List | pages
The pages. |
protected boolean | poolingEnabled |
protected JspRuntimeContext | rctxt
The runtime context.
|
protected File | scratchDir |
protected CharArrayWriter | servletout |
protected boolean | showSuccess |
protected boolean | smapDumped |
protected boolean | smapSuppressed |
protected static String | SHOW_SUCCESS |
protected static String | SWITCH_ADD_WEBAPP_XML_MAPPINGS |
protected static String | SWITCH_BLOCK_EXTERNAL |
protected static String | SWITCH_CACHE |
protected static String | SWITCH_CLASSPATH |
protected static String | SWITCH_CLASS_NAME |
protected static String | SWITCH_COMPILE |
protected static String | SWITCH_DIE |
protected static String | SWITCH_DUMP_SMAP |
protected static String | SWITCH_ENCODING |
protected static String | SWITCH_FILE_WEBAPP |
protected static String | SWITCH_FULL_STOP |
protected static String | SWITCH_HELP |
protected static String | SWITCH_MAPPED |
protected static String | SWITCH_OUTPUT_DIR |
protected static String | SWITCH_PACKAGE_NAME |
protected static String | SWITCH_POOLING |
protected static String | SWITCH_SMAP |
protected static String | SWITCH_SOURCE |
protected static String | SWITCH_TARGET |
protected static String | SWITCH_TRIM_SPACES |
protected static String | SWITCH_URI_BASE |
protected static String | SWITCH_URI_ROOT |
protected static String | SWITCH_VALIDATE_TLD |
protected static String | SWITCH_VERBOSE |
protected static String | SWITCH_WEBAPP_INC |
protected static String | SWITCH_WEBAPP_XML |
protected static String | SWITCH_WEBAPP_XML_ENCODING |
protected static String | SWITCH_XPOWERED_BY |
protected TagPluginManager | tagPluginManager |
protected String | targetClassName |
protected String | targetPackage |
protected TldLocationsCache | tldLocationsCache
Cache for the TLD locations |
protected boolean | trimSpaces |
protected String | uriBase |
protected String | uriRoot |
protected boolean | validateTld |
protected boolean | verbose |
protected String | webxmlEncoding |
protected String | webxmlFile |
protected int | webxmlLevel |
protected boolean | xpoweredBy |
Method Summary | |
---|---|
protected void | addExtension(String extension)
Adds the given file extension to the
list of extensions handled as JSP files.
|
protected void | completeWebXml() |
void | generateWebMapping(String file, JspCompilationContext clctxt)
Adds servlet declaration and mapping for the JSP page servlet to the
generated web.xml fragment.
|
boolean | genStringAsCharArray() |
Map | getCache() |
int | getCheckInterval()
In JspC this always returns 0 .
|
boolean | getClassDebugInfo() |
String | getClassPath() |
String | getCompiler() |
String | getCompilerClassName() |
String | getCompilerSourceVM() |
String | getCompilerTargetVM() |
boolean | getDevelopment()
In JspC this always returns false .
|
boolean | getDisplaySourceFragment()
In JspC this always returns true .
|
boolean | getErrorOnUseBeanInvalidClassAttribute() |
List | getExtensions()
Returns the list of file extensions
that are treated as JSP files.
|
boolean | getFailOnError()
Returns true if an exception will be thrown in case of a compilation
error. |
boolean | getFork() |
String | getIeClassId() |
String | getJavaEncoding()
Returns the encoding to use for
java files. |
JspConfig | getJspConfig() |
boolean | getKeepGenerated()
In JspC this always returns true .
|
boolean | getMappedFile() |
int | getModificationTestInterval()
In JspC this always returns 0 .
|
boolean | getRecompileOnFail()
In JspC this always returns false .
|
File | getScratchDir() |
TagPluginManager | getTagPluginManager() |
TldLocationsCache | getTldLocationsCache() |
boolean | getTrimSpaces() |
protected void | initClassLoader(JspCompilationContext clctxt)
Initializes the classloader as/if needed for the given
compilation context.
|
protected void | initServletContext() |
protected void | initWebXml() |
boolean | isBlockExternal() |
boolean | isCaching() |
boolean | isPoolingEnabled() |
boolean | isSmapDumped() |
boolean | isSmapSuppressed() |
boolean | isValidateTld() |
boolean | isXpoweredBy() |
protected void | locateUriRoot(File f)
Find the WEB-INF dir by looking up in the directory tree.
|
static void | main(String[] arg) |
protected void | mergeIntoWebXml()
Include the generated web.xml inside the webapp's web.xml. |
protected String | nextArg() |
protected String | nextFile() |
protected void | processFile(String file) |
protected File | resolveFile(String s)
Resolves the relative or absolute pathname correctly
in both Ant and command-line situations. |
void | scanFiles(File base)
Locate all jsp files in the webapp. |
void | setAddWebXmlMappings(boolean b)
Sets the option to merge generated web.xml fragment into the
WEB-INF/web.xml file of the web application that we were processing.
|
void | setArgs(String[] arg)
Apply command-line arguments.
|
void | setBlockExternal(boolean b) |
void | setCaching(boolean caching)
Sets the option to enable caching.
|
void | setClassDebugInfo(boolean b)
Sets the option to include debug information in compiled class. |
void | setClassName(String p)
Class name of the generated file ( without package ).
|
void | setClassPath(String s)
Sets the classpath used while compiling the servlets generated from JSP
files |
void | setCompile(boolean b)
Sets the compile flag.
|
void | setCompiler(String c)
Sets the option to determine what compiler to use.
|
void | setCompilerSourceVM(String vm)
Sets the compiler source VM.
|
void | setCompilerTargetVM(String vm)
Sets the compiler target VM.
|
void | setErrorOnUseBeanInvalidClassAttribute(boolean b)
Sets the option to issue a compilation error if the class attribute
specified in useBean action is invalid. |
void | setFailOnError(boolean b)
Sets the option that throws an exception in case of a compilation error. |
void | setGenStringAsCharArray(boolean genStringAsCharArray)
Determines whether text strings are to be generated as char arrays,
which improves performance in some cases.
|
void | setIeClassId(String ieClassId)
Sets the class-id value to be sent to Internet Explorer when using
<jsp:plugin> tags.
|
void | setJavaEncoding(String encodingName)
Sets the encoding to use for
java files.
|
void | setJspFiles(String jspFiles)
Parses comma-separated list of JSP files to be processed. |
void | setListErrors(boolean b) |
void | setOutputDir(String s) |
void | setPackage(String p)
Sets the package name to be used for the generated servlet classes. |
void | setPoolingEnabled(boolean poolingEnabled)
Sets the option to enable the tag handler pooling. |
void | setSmapDumped(boolean smapDumped)
Sets smapDumped flag.
|
void | setSmapSuppressed(boolean smapSuppressed)
Sets smapSuppressed flag. |
void | setTrimSpaces(boolean ts)
Sets the option to trim white spaces between directives or actions. |
void | setUriroot(String s)
Base dir for the webapp. |
void | setValidateTld(boolean b) |
void | setVerbose(int level)
Sets the verbosity level. |
void | setWebXml(String s)
File where we generate a complete web.xml with the class definitions. |
void | setWebXmlEncoding(String encoding)
Sets the encoding to be used to read and write web.xml files.
|
void | setWebXmlFragment(String s)
File where we generate a web.xml fragment with the class definitions. |
void | setXpoweredBy(boolean xpoweredBy)
Sets the option to enable generation of X-Powered-By response header. |
Parameters: extension The extension to add, e.g. "myjsp"
Parameters: file
Context-relative path to the JSP file, e.g.
/index.jsp
clctxt
Compilation context of the servlet
0
.
{@inheritDoc }false
.
{@inheritDoc }true
.
{@inheritDoc }Returns: The list of extensions
Returns: String The encoding
true
.
{@inheritDoc }0
.
{@inheritDoc }false
.
{@inheritDoc }Parameters: clctxt The compilation context
Throws: IOException If an error occurs
Parameters: s The file
Returns: The file resolved
Parameters: b
true
to merge the fragment into the existing
web.xml file of the processed web application
({uriroot}/WEB-INF/web.xml), false
to keep the
generated web.xml fragment
Parameters: arg The arguments
See Also: isCaching
Parameters: b Flag value
See Also: getCompiler
See Also: getCompilerSourceVM
See Also: getCompilerTargetVM
Parameters: genStringAsCharArray true if text strings are to be generated as char arrays, false otherwise
Parameters: ieClassId Class-id value
Parameters: encodingName The name, e.g. "UTF-8"
Each file is interpreted relative to uriroot, unless it is absolute, in which case it must start with uriroot.
Parameters: jspFiles Comma-separated list of JSP files to be processed
See Also: isSmapDumped
Parameters: level Positive means verbose
If not specified, defaults to the platform default encoding.
Parameters: encoding Encoding, e.g. "UTF-8".