public class JspC
extends org.apache.tools.ant.Task
Here is an example of a build script with multiple targets, each with different attributes. The following commands can be used to execute the script: On Windows: ant -Dwas.home=%WAS_HOME% -Dear.path=%EAR_PATH% -Dextract.dir=%EXTRACT_DIR% ant jspc2 -Dwas.home=%WAS_HOME% -Dapp.name=%APP_NAME% -Dwebmodule.name=%MOD_NAME% ant jspc3 -Dwas.home=%WAS_HOME% -Dapp.name=%APP_NAME% -Dwebmodule.name=%MOD_NAME% -Ddir.name=%DIR_NAME% On Unix: ant -Dwas.home=$WAS_HOME -Dear.path=$EAR_PATH -Dextract.dir=$EXTRACT_DIR ant jspc2 -Dwas.home=$WAS_HOME -Dapp.name=$APP_NAME -Dwebmodule.name=$MOD_NAME ant jspc3 -Dwas.home=$WAS_HOME -Dapp.name=$APP_NAME -Dwebmodule.name=$MOD_NAME -Ddir.name=$DIR_NAME
<taskdef name="wsjspc" classname="com.ibm.websphere.ant.tasks.JspC"/>
<target name="jspc1" description="example using a path to an EAR, and extracting the EAR to a directory">
<wsjspc wasHome="${was.home}"
earpath="${ear.path}"
forcecompilation="true"
extractToDir="${extract.dir}"
useThreadTagPool="true"
keepgenerated="true"
jspCompileClasspath=""
/>
</target>
<arget name="jspc2" description="example using an enterprise app and webmodule">
<wsjspc wasHome="${was.home}"
enterpriseAppName="${app.name}"
webmoduleName="${webmodule.name}"
removeTempDir="true"
forcecompilation="true"
keepgenerated="true"
jspCompileClasspath=""
/>
</target>
<target name="jspc3" description="example using an enterprise app, webmodule and specific directory">
<wsjspc wasHome="${was.home}"
enterpriseAppName="${app.name}"
webmoduleName="${webmodule.name}"
fileName="${dir.name}"
recurse="false"
forcecompilation="true"
keepgenerated="true"
jspCompileClasspath=""
/>
</target>
</project>
The attributes of the JspC task are shown here:
<wsJspC earPath="full path to single compressed or expanded enterprise application archive"
warPath="full path to single compressed or expanded web application archive"
src="same as warPath - for backward compatibility"
enterpriseAppName="name of a deployed Enterprise Application"
responseFile="a file that contains pararmeters to be used by the Batch Compiler"
webmoduleName="name of a single webmodule within an EAR or Enterprise Application"
fileName="a single JSP filename or directory name within a Web Module"
recurse="specifies whether a directory named in the fileName attribute should be recursed"
configRoot="location of the WebSphere configuration directory"
cellName="cell name where the requested Enterprise Application is installed"
nodeName="node name where the requested Enterprise Application is installed"
serverName="server name where the requested Enterprise Application is installed"
profileName="name of the profile in which the requested Enterprise Application is installed"
translate="when false, JSPs will not be translated and compiled. Used only in conjunction with removeTempDir"
compile="when false, JSPs will only be syntax-checked and translated and not compiled"
removeTempDir="specify whether a web module's temp directory should be removed. Can only be used when enterpriseApp is given"
extractToDir="directory into which predeployed EARs and WARs will be extracted before compilation is performed"
compileToWebInf="the target directory for the compiled JSP classfiles should be the Web Module's WEB-INF/classes directory instead of the WAS temp directory"
compileToDir="directory into which JSPs will be translated into Java sourcefiles and compiled into classfiles"
toDir="same as compileToDir - for backward compatibility"
forceCompilation="all JSP resources will be compiled even if a JSP is not outdated"
useFullPackageNames="generate full package names for JSP classes"
trackDependencies="a JSP will be compiled if any of its dependencies have changed, even if the JSP itself has not changed"
createDebugClassfiles="the Java class files generated by the JSP compiler should be compiled to generate all debugging info"
keepgenerated="the Java files generated by the JSP compiler during the translation phase of the processing should be kept"
keepGeneratedclassfiles="the class files generated by the JSP compiler during the translation phase of the processing should be kept"
usePageTagPool="Enables or disables the reuse of custom tag handlers on an individual JavaServer Page basis"
useThreadTagPool="Enables or disables the reuse of custom tag handlers on a per request thread basis per Web Application Archive (WAR)"
classloaderParentFirst="Search order for loading classes. Default is to search parent classloader prior to application classloader"
classloaderSingleWarClassloader="Specify whether to use one classloader per Enterprise Application Archive (EAR) or one classloader per Web Application Archive (WAR)"
additionalClasspath="additional classpath entries to be used when parsing and compiling JSP pages"
classpath="same as additionalClasspath - for backward compatibility"
jspCompileClasspath="instructs JSP engine to use a small classpath for the java compilation phase"
verbose="Specify whether to output messages about what the compiler is doing when the JSP is compiled"
deprecation="Specify whether deprecation warnings should be emitted when the JSP is compiled"
javaEncoding="Specify the encoding that will be used by the Java compiler when it writes the generated .java file."
compilerOptions="Specify a list of strings to be passed on the java compiler command. This is a space-separated list of the form arg1 arg2 argn"
compileWithAssert="Specify whether the generated java classes should contain support for JDK 1.4 Assertions"
jdkSourceLevel="Specify the source level for the java compiler"
useJikes="Specify whether Jikes should be used for compiling Java sources"
useJDKCompiler="Specify whether the JDK compiler should be used for compiling Java sources. The default is to use the JDT compiler."
useRepeatInt="The 'index' attribute of the tsx:repeat tag in version 6.0 is java.lang.Integer. Set this flag to true if your JSPs use the primitive integer (int) for this attribute."
allowJspOutputElementMismatch="In the jsp:output element, multiple occurrences of the doctype-root-element , doctype-system or doctype-public properties should cause an translation error if the values for the properties differ from the previous occurence. The default behavior of WAS is to raise a translation error. Set this flag to true to tell WAS to NOT raise a translation error under these conditions."
allowTaglibPrefixRedefinition="If a taglibrary prefix was already defined with a different URI within a JSP, WAS will raise a translation error. Set this flag to true to tell WAS to NOT raise a translation error under these conditions."
allowTaglibPrefixUseBeforeDefinition="If a taglibrary prefix is used before the tag directive that defines the prefix, WAS will raise a translation error. Set this flag to true to tell WAS to NOT raise a translation error under these conditions."
allowUnmatchedEndTag="In WebSphere version 5, improper termination of end tags was ignored while in WebSphere V6 a translation exception is thrown. Set this flag to true to tell WAS to NOT raise a translation error under these conditions."
useIterationEval="In WebSphere version 5,the loop conditions for custom tags were evaluates based on the condition criteria in the loop condition, while in v6 this was changed. Set this flag to true to tell WAS to base iterations on the criteria in the loop condition
useScriptVarDupInit="In version 5, WAS declared a tag variable each time it was encountered within a scriptlet If-Else condition, even if the variable had a 'page' scope. Version 6 correctly does not do this. For backward compatibility, set this attribute to true."
useCDataTrim="Enables or disables the trimming of whitespaces before a CDATA section is created"
disableURLEncodingForParamTag="Enables or disables the encoding of jsp params in jsp:param tag by page authors"
jspFileExtensions="Specify the file extensions to be processed by the batch compiler. This is a semicolon- or colon-separated list of the form *.ext1;*.ext2:*.extn"
logLevel="Specify the level of logging that will be directed to the console during batch compilation"
wasHome="websphere install directory"
classpathref="ear classes reference element name"
jvmMaxMemory="256M"
fileEncoding="UTF8" />
******** One and only one of the following four attributes is required ******
The earPath attribute is the full path to single compressed or expanded enterprise application archive
The warPath attribute is the full path to single compressed or expanded web application archive
The src attribute is the same as warPath - for backward compatibility
The enterpriseAppName attribute is the name of a deployed Enterprise Application
******** Optional attributes ******
The responseFile attribute specifies a file that contains pararmeters to be used by the Batch Compiler
The webmoduleName attribute is the name of a single webmodule within an EAR or Enterprise Application
The fileName attribute is a single JSP filename or directory name within a Web Module
The recurse attribute specifies whether a directory named in the fileName attribute should be recursed
The configRoot attribute is the location of the WebSphere configuration directory
The cellName attribute is the cell name where the requested Enterprise Application is installed
The nodeName attribute is the node name where the requested Enterprise Application is installed
The serverName attribute is the server name where the requested Enterprise Application is installed
The profileName attribute is the name of the profile in which the requested Enterprise Application is installed
The translate attribute, when false, indicates JSPs should not be translated and compiled. Used only in conjunction with removeTempDir
The compile attribute, when false, indicates that JSPs will only be syntax-checked and translated, but not compiled.
The removeTempDir attribute indicates that a web module's temp directory should be removed. Can only be used when enterpriseApp is given
The extractToDir attribute is the directory into which predeployed EARs and WARs will be extracted
before compilation is performed
The compileToWebInf attribute is the the target directory for the compiled JSP classfiles should be
the Web Module's WEB-INF/classes directory instead of the WAS temp directory
The compileToDir attribute is the directory into which JSPs will be translated into Java sourcefiles
and compiled into classfiles
The toDir attribute is the same as compileToDir - for backward compatibility
The forceCompilation attribute specifies that all JSP resources will be compiled even if a JSP is not outdated
The useFullPackageNames attribute specifies that full package names will be generated for JSP classes
The trackDependencies attribute specifies that a JSP will be compiled if any of its dependencies
have changed, even if the JSP itself has not changed
The createDebugClassfiles attribute specifies that the Java class files generated by the JSP compiler
should be compiled to generate all debugging info
The keepgenerated attribute specifies that the Java files generated by the JSP compiler during the
translation phase of the processing should be kept
The keepGeneratedclassfiles attribute specifies that the class files generated by the JSP compiler
during the translation phase of the processing should be kept
The usePageTagPool attribute enables or disables the reuse of custom tag handlers on an individual
JavaServer Page basis
The useThreadTagPool attribute enables or disables the reuse of custom tag handlers on a per request
thread basis per Web Application Archive (WAR)
The classloaderParentFirst attribute is the search order for loading classes. Default is to search
parent classloader prior to application classloader
The classloaderSingleWarClassloader attribute specifies whether to use one classloader per Enterprise
Application Archive (EAR) or one classloader per Web Application Archive (WAR)
The additionalClasspath attribute specifies additional classpath entries to be used when parsing and
compiling JSP pages
The classpath attribute specifies extra, ear classes that are needed to compile the JSPs.
It is the same as additionalClasspath - for backward compatibility
The jspCompileClasspathinstructs JSP engine to use a small classpath for the java compilation phase
The verbose attribute specifies whether to output messages about what the compiler is doing when the
JSP is compiled
The deprecation attribute specifies whether deprecation warnings should be emitted when the JSP is compiled
The javaEncoding attribute specifies the encoding that will be used by the Java compiler when it writes the generated .java file.
The compilerOptions attribute specifies a list of strings to be passed on the java compiler command. This is a space-separated list of the form arg1 arg2 argn
The compileWithAssert attribute specifies whether the generated java classes should contain support for JDK 1.4 Assertions
The jdkSourceLevel attribute specifies the source level for the java compiler
The useJikes attribute specifies whether Jikes should be used for compiling Java sources
The useJDKCompiler attribute specifies whether the JDK compiler should be used for compiling Java sources
The useRepeatInt attribute specifies whether the 'index' attribute of the tsx:repeat tag in version 6.0 should be treated as a primitive integer (int). The default in Version 6.0 is java.lang.Integer. Set this flag to true if your JSPs use int for this attribute.
The allowJspOutputElementMismatchIn the jsp:output element, multiple occurrences of the doctype-root-element , doctype-system or doctype-public properties should cause an translation error if the values for the properties differ from the previous occurence. The default behavior of WAS is to not raise a translation error. Set this flag to false to tell WAS to raise a translation error under these conditions.
The allowTaglibPrefixRedefinitionIf a taglibrary prefix was already defined with a different URI within a JSP, WAS will raise a translation error. Set this flag to true to tell WAS to NOT raise a translation error under these conditions.
The allowTaglibPrefixUseBeforeDefinitionIf a taglibrary prefix is used before the tag directive that defines the prefix, WAS will raise a translation error. Set this flag to true to tell WAS to NOT raise a translation error under these conditions.
The allowUnmatchedEndTagIn WebSphere version 5, improper termination of end tags was ignored while in WebSphere V6 a translation exception is thrown. Set this flag to true to tell WAS to NOT raise a translation error under these conditions.
The useIterationEvalIn WebSphere version 5, loops in Iteration tags were evaluated based on loop condition criteria while in v6 condition was evaluated inside the loop which enters an infinite loop in certain scenarios.Set this flag to true to tell WAS to base the iterations similar to v5.
The useScriptVarDupInitIn version 5, WAS declared a tag variable each time it was encountered within a scriptlet If-Else condition, even if the variable had a 'page' scope. Version 6 correctly does not do this. For backward compatibility, set this attribute to true.
The useCDataTrim attribute enables or disables the trimming of whitespaces before creating a CData section
The disableURLEncodingForParamTag attribute enables or disables jsp params encoding in jsp:param tag by page authors
The jspFileExtensions attribute specifies the file extensions to be processed by the batch compiler
The logLevel attribute specifies the level of logging that will be directed to the console during batch
compilation
The wasHome attribute contains the location of the WebSphere Installation Directory.
The classpathref attribute is optional and does the same thing as the classpath attribute, but
is specified as an Ant path reference.
The jvmMaxMemory attribute is optional and sets maximum size of the memory for the underlying VM. Defaults to 256M
The fileEncoding attribute is optional and sets the file.encoding System Property for the underlying VM.
Copyright IBM Corp. 2002, 2003
Source File: JspC.java
Creation Date: May 17, 2002; modified April 27, 2004
Constructor and Description |
---|
JspC()
Constructor for JspC
|
Modifier and Type | Method and Description |
---|---|
org.apache.tools.ant.types.Path |
createClasspath()
Maybe creates a nested classpath element.
|
void |
execute() |
protected java.lang.String |
getToolsJar() |
boolean |
isDebug() |
void |
setAdditionalClasspath(java.lang.String string) |
void |
setAllowJspOutputElementMismatch(java.lang.String string) |
void |
setAllowTaglibPrefixRedefinition(java.lang.String string) |
void |
setAllowTaglibPrefixUseBeforeDefinition(java.lang.String string) |
void |
setAllowUnmatchedEndTag(java.lang.String string) |
void |
setCellName(java.lang.String string) |
void |
setClassloaderParentFirst(java.lang.String string) |
void |
setClassloaderSingleWarClassloader(java.lang.String string) |
void |
setClasspath(org.apache.tools.ant.types.Path classpath)
Sets the classpath
|
void |
setClasspath(java.lang.String string) |
void |
setClasspathRef(org.apache.tools.ant.types.Reference r)
Adds a reference to a CLASSPATH defined elsewhere.
|
void |
setCompile(java.lang.String string) |
void |
setCompileClasspath(org.apache.tools.ant.types.Path path) |
void |
setCompilerOptions(java.lang.String string) |
void |
setCompileToDir(java.lang.String string) |
void |
setCompileToWebInf(java.lang.String string) |
void |
setCompileWithAssert(java.lang.String string)
Deprecated.
setCompileWithAssert is replaced by
setJdkSourceLevel(java.lang.String) |
void |
setConfigRoot(java.lang.String string) |
void |
setCreateDebugClassfiles(java.lang.String string) |
void |
setDebug(boolean debug) |
void |
setDeprecation(java.lang.String string) |
void |
setDisableURLEncodingForParamTag(java.lang.String string) |
void |
setEarPath(java.lang.String string) |
void |
setEnterpriseAppName(java.lang.String string) |
void |
setExtractToDir(java.lang.String string) |
void |
setFailonerror(boolean failonerror)
Sets the failonerror.
|
void |
setFileEncoding(java.lang.String fileEncoding) |
void |
setFileName(java.lang.String string) |
void |
setForceCompilation(java.lang.String string) |
void |
setFork(boolean fork)
Sets the fork.
|
void |
setJavaEncoding(java.lang.String string) |
void |
setJdkSourceLevel(java.lang.String string) |
void |
setJspCompileClasspath(java.lang.String string) |
void |
setJspFileExtensions(java.lang.String string) |
void |
setJvmMaxMemory(java.lang.String jvmMaxMemory)
Sets the jvmMaxMemory.
|
void |
setKeepgenerated(java.lang.String string) |
void |
setKeepGeneratedclassfiles(java.lang.String string) |
void |
setLogLevel(java.lang.String string) |
void |
setNodeName(java.lang.String string) |
void |
setProfileName(java.lang.String string) |
void |
setRecurse(java.lang.String string) |
void |
setRemoveTempDir(java.lang.String string) |
void |
setResponseFile(java.lang.String string) |
void |
setServerName(java.lang.String string) |
void |
setSrc(java.lang.String src)
Sets the src.
|
void |
setToDir(java.lang.String toDir)
Sets the toDir.
|
void |
setTrackDependencies(java.lang.String string) |
void |
setTranslate(java.lang.String string) |
void |
setUseCDataTrim(java.lang.String string) |
void |
setUseFullPackageNames(java.lang.String string) |
void |
setUseIterationEval(java.lang.String string) |
void |
setUseJDKCompiler(java.lang.String string) |
void |
setUseJikes(java.lang.String string) |
void |
setUsePageTagPool(java.lang.String string) |
void |
setUseRepeatInt(java.lang.String string) |
void |
setUseScriptVarDupInit(java.lang.String string) |
void |
setUseThreadTagPool(java.lang.String string) |
void |
setVerbose(java.lang.String string) |
void |
setWarPath(java.lang.String string) |
void |
setWasHome(java.lang.String wasHome)
Sets the wasHome.
|
void |
setWebmoduleName(java.lang.String string) |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
Task.execute()
public void setWasHome(java.lang.String wasHome)
wasHome
- The wasHome to setpublic void setFailonerror(boolean failonerror)
failonerror
- The failonerror to setpublic void setSrc(java.lang.String src)
src
- The src to setpublic void setToDir(java.lang.String toDir)
toDir
- The toDir to setpublic org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
public void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath
- The classpath to setpublic void setFork(boolean fork)
fork
- The fork to setprotected java.lang.String getToolsJar()
public void setAdditionalClasspath(java.lang.String string)
string
- public void setCellName(java.lang.String string)
string
- public void setClassloaderParentFirst(java.lang.String string)
string
- public void setClassloaderSingleWarClassloader(java.lang.String string)
string
- public void setClasspath(java.lang.String string)
string
- public void setCompileClasspath(org.apache.tools.ant.types.Path path)
path
- public void setCompileToDir(java.lang.String string)
string
- public void setCompileToWebInf(java.lang.String string)
string
- public void setConfigRoot(java.lang.String string)
string
- public void setCreateDebugClassfiles(java.lang.String string)
string
- public void setDeprecation(java.lang.String string)
string
- public void setJavaEncoding(java.lang.String string)
string
- public void setCompileWithAssert(java.lang.String string)
setJdkSourceLevel(java.lang.String)
string
- public void setJdkSourceLevel(java.lang.String string)
string
- public void setEarPath(java.lang.String string)
string
- public void setEnterpriseAppName(java.lang.String string)
string
- public void setExtractToDir(java.lang.String string)
string
- public void setFileName(java.lang.String string)
string
- public void setForceCompilation(java.lang.String string)
string
- public void setUseFullPackageNames(java.lang.String string)
string
- public void setKeepgenerated(java.lang.String string)
string
- public void setKeepGeneratedclassfiles(java.lang.String string)
string
- public void setLogLevel(java.lang.String string)
string
- public void setNodeName(java.lang.String string)
string
- public void setResponseFile(java.lang.String string)
string
- public void setServerName(java.lang.String string)
string
- public void setProfileName(java.lang.String string)
public void setTrackDependencies(java.lang.String string)
string
- public void setUseJikes(java.lang.String string)
string
- public void setUseJDKCompiler(java.lang.String string)
string
- public void setUseRepeatInt(java.lang.String string)
public void setAllowJspOutputElementMismatch(java.lang.String string)
public void setAllowTaglibPrefixRedefinition(java.lang.String string)
public void setAllowTaglibPrefixUseBeforeDefinition(java.lang.String string)
public void setAllowUnmatchedEndTag(java.lang.String string)
public void setUseScriptVarDupInit(java.lang.String string)
public void setUseIterationEval(java.lang.String string)
public void setUseCDataTrim(java.lang.String string)
public void setDisableURLEncodingForParamTag(java.lang.String string)
string
- public void setUsePageTagPool(java.lang.String string)
string
- public void setUseThreadTagPool(java.lang.String string)
string
- public void setVerbose(java.lang.String string)
string
- public void setWarPath(java.lang.String string)
string
- public void setWebmoduleName(java.lang.String string)
string
- public void setJspFileExtensions(java.lang.String string)
string
- public void setCompile(java.lang.String string)
string
- public void setCompilerOptions(java.lang.String string)
string
- public void setJspCompileClasspath(java.lang.String string)
string
- public void setRecurse(java.lang.String string)
string
- public void setRemoveTempDir(java.lang.String string)
string
- public void setTranslate(java.lang.String string)
string
- public void setJvmMaxMemory(java.lang.String jvmMaxMemory)
jvmMaxMemory
- The JVM MaxMemory to setpublic boolean isDebug()
public void setDebug(boolean debug)
debug
- public void setFileEncoding(java.lang.String fileEncoding)
fileEncoding
- The fileEncoding to set.