com.ibm.websphere.ant.tasks
Class JspC
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- com.ibm.websphere.ant.tasks.JspC
-
- All Implemented Interfaces:
- java.lang.Cloneable
public class JspC extends org.apache.tools.ant.Task
The JspC task compiles JSP files into .class files.
JspC is included in WebSphere Application Server and is found in the jar wsanttasks.jar.
JspC is an Ant front-end to the WebSphere JSP Batch Compiler. Descriptions of the attributes can be found in the Infocenter, and in the file batchcompiler.properties.default in {WAS_ROOT}/bin.
Below 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
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.
- Version:
- 2.0
- See Also:
Copyright IBM Corp. 2002, 2003 Source File: JspC.java Creation Date: May 17, 2002; modified April 27, 2004
-
-
Constructor Summary
Constructors Constructor and Description JspC()
Constructor for JspC
-
Method Summary
Methods 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 classpathvoid
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 bysetJdkSourceLevel(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)
-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException
- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
- See Also:
Task.execute()
-
setWasHome
public void setWasHome(java.lang.String wasHome)
Sets the wasHome.- Parameters:
wasHome
- The wasHome to set
-
setFailonerror
public void setFailonerror(boolean failonerror)
Sets the failonerror.- Parameters:
failonerror
- The failonerror to set
-
setSrc
public void setSrc(java.lang.String src)
Sets the src.- Parameters:
src
- The src to set
-
setToDir
public void setToDir(java.lang.String toDir)
Sets the toDir.- Parameters:
toDir
- The toDir to set
-
createClasspath
public org.apache.tools.ant.types.Path createClasspath()
Maybe creates a nested classpath element.
-
setClasspathRef
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
Adds a reference to a CLASSPATH defined elsewhere.
-
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path classpath)
Sets the classpath- Parameters:
classpath
- The classpath to set
-
setFork
public void setFork(boolean fork)
Sets the fork.- Parameters:
fork
- The fork to set
-
getToolsJar
protected java.lang.String getToolsJar()
-
setAdditionalClasspath
public void setAdditionalClasspath(java.lang.String string)
- Parameters:
string
-
-
setCellName
public void setCellName(java.lang.String string)
- Parameters:
string
-
-
setClassloaderParentFirst
public void setClassloaderParentFirst(java.lang.String string)
- Parameters:
string
-
-
setClassloaderSingleWarClassloader
public void setClassloaderSingleWarClassloader(java.lang.String string)
- Parameters:
string
-
-
setClasspath
public void setClasspath(java.lang.String string)
- Parameters:
string
-
-
setCompileClasspath
public void setCompileClasspath(org.apache.tools.ant.types.Path path)
- Parameters:
path
-
-
setCompileToDir
public void setCompileToDir(java.lang.String string)
- Parameters:
string
-
-
setCompileToWebInf
public void setCompileToWebInf(java.lang.String string)
- Parameters:
string
-
-
setConfigRoot
public void setConfigRoot(java.lang.String string)
- Parameters:
string
-
-
setCreateDebugClassfiles
public void setCreateDebugClassfiles(java.lang.String string)
- Parameters:
string
-
-
setDeprecation
public void setDeprecation(java.lang.String string)
- Parameters:
string
-
-
setJavaEncoding
public void setJavaEncoding(java.lang.String string)
- Parameters:
string
-
-
setCompileWithAssert
public void setCompileWithAssert(java.lang.String string)
Deprecated. setCompileWithAssert is replaced bysetJdkSourceLevel(java.lang.String)
- Parameters:
string
-
-
setJdkSourceLevel
public void setJdkSourceLevel(java.lang.String string)
- Parameters:
string
-
-
setEarPath
public void setEarPath(java.lang.String string)
- Parameters:
string
-
-
setEnterpriseAppName
public void setEnterpriseAppName(java.lang.String string)
- Parameters:
string
-
-
setExtractToDir
public void setExtractToDir(java.lang.String string)
- Parameters:
string
-
-
setFileName
public void setFileName(java.lang.String string)
- Parameters:
string
-
-
setForceCompilation
public void setForceCompilation(java.lang.String string)
- Parameters:
string
-
-
setUseFullPackageNames
public void setUseFullPackageNames(java.lang.String string)
- Parameters:
string
-
-
setKeepgenerated
public void setKeepgenerated(java.lang.String string)
- Parameters:
string
-
-
setKeepGeneratedclassfiles
public void setKeepGeneratedclassfiles(java.lang.String string)
- Parameters:
string
-
-
setLogLevel
public void setLogLevel(java.lang.String string)
- Parameters:
string
-
-
setNodeName
public void setNodeName(java.lang.String string)
- Parameters:
string
-
-
setResponseFile
public void setResponseFile(java.lang.String string)
- Parameters:
string
-
-
setServerName
public void setServerName(java.lang.String string)
- Parameters:
string
-
-
setProfileName
public void setProfileName(java.lang.String string)
-
setTrackDependencies
public void setTrackDependencies(java.lang.String string)
- Parameters:
string
-
-
setUseJikes
public void setUseJikes(java.lang.String string)
- Parameters:
string
-
-
setUseJDKCompiler
public void setUseJDKCompiler(java.lang.String string)
- Parameters:
string
-
-
setUseRepeatInt
public void setUseRepeatInt(java.lang.String string)
-
setAllowJspOutputElementMismatch
public void setAllowJspOutputElementMismatch(java.lang.String string)
-
setAllowTaglibPrefixRedefinition
public void setAllowTaglibPrefixRedefinition(java.lang.String string)
-
setAllowTaglibPrefixUseBeforeDefinition
public void setAllowTaglibPrefixUseBeforeDefinition(java.lang.String string)
-
setAllowUnmatchedEndTag
public void setAllowUnmatchedEndTag(java.lang.String string)
-
setUseScriptVarDupInit
public void setUseScriptVarDupInit(java.lang.String string)
-
setUseIterationEval
public void setUseIterationEval(java.lang.String string)
-
setUseCDataTrim
public void setUseCDataTrim(java.lang.String string)
-
setDisableURLEncodingForParamTag
public void setDisableURLEncodingForParamTag(java.lang.String string)
- Parameters:
string
-
-
setUsePageTagPool
public void setUsePageTagPool(java.lang.String string)
- Parameters:
string
-
-
setUseThreadTagPool
public void setUseThreadTagPool(java.lang.String string)
- Parameters:
string
-
-
setVerbose
public void setVerbose(java.lang.String string)
- Parameters:
string
-
-
setWarPath
public void setWarPath(java.lang.String string)
- Parameters:
string
-
-
setWebmoduleName
public void setWebmoduleName(java.lang.String string)
- Parameters:
string
-
-
setJspFileExtensions
public void setJspFileExtensions(java.lang.String string)
- Parameters:
string
-
-
setCompile
public void setCompile(java.lang.String string)
- Parameters:
string
-
-
setCompilerOptions
public void setCompilerOptions(java.lang.String string)
- Parameters:
string
-
-
setJspCompileClasspath
public void setJspCompileClasspath(java.lang.String string)
- Parameters:
string
-
-
setRecurse
public void setRecurse(java.lang.String string)
- Parameters:
string
-
-
setRemoveTempDir
public void setRemoveTempDir(java.lang.String string)
- Parameters:
string
-
-
setTranslate
public void setTranslate(java.lang.String string)
- Parameters:
string
-
-
setJvmMaxMemory
public void setJvmMaxMemory(java.lang.String jvmMaxMemory)
Sets the jvmMaxMemory.- Parameters:
jvmMaxMemory
- The JVM MaxMemory to set
-
isDebug
public boolean isDebug()
- Returns:
-
setDebug
public void setDebug(boolean debug)
- Parameters:
debug
-
-
setFileEncoding
public void setFileEncoding(java.lang.String fileEncoding)
- Parameters:
fileEncoding
- The fileEncoding to set.
-
-