org.apache.tools.ant.taskdefs.optional.jsp
public class JspC extends MatchingTask
This task takes the given jsp files and compiles them into java files. It is then up to the user to compile the java files into classes.
The task requires the srcdir and destdir attributes to be set. This Task is a MatchingTask, so the files to be compiled can be specified using includes/excludes attributes or nested include/exclude elements. Optional attributes are verbose (set the verbosity level passed to jasper), package (name of the destination package for generated java classes and classpath (the classpath to use when running the jsp compiler).
This task supports the nested elements classpath (A Path) and classpathref (A Reference) which can be used in preference to the attribute classpath, if the jsp compiler is not already in the ant classpath.
<jspc srcdir="${basedir}/src/war" destdir="${basedir}/gensrc" package="com.i3sp.jsp" verbose="9"> <include name="**\/*.jsp" /> </jspc>
Large Amount of cutting and pasting from the Javac task...
Since: 1.5
Nested Class Summary | |
---|---|
static class | JspC.WebAppParameter
static inner class used as a parameter element |
Field Summary | |
---|---|
protected Vector | compileList |
protected boolean | failOnError
flag to control action on execution trouble |
protected JspC.WebAppParameter | webApp
web apps |
Method Summary | |
---|---|
void | addWebApp(JspC.WebAppParameter webappParam)
Adds a single webapp.
|
Path | createClasspath()
Adds a path to the classpath. |
Path | createCompilerclasspath()
Support nested compiler classpath, used to locate compiler adapter |
void | deleteEmptyJavaFiles()
delete any java output files that are empty
this is to get around a little defect in jasper: when it
fails, it leaves incomplete files around. |
void | execute()
execute by building up a list of files that
have changed and hand them off to a jsp compiler |
Path | getClasspath()
Get the classpath. |
Vector | getCompileList()
get the list of files to compile |
Path | getCompilerclasspath()
get the classpath used to find the compiler adapter |
File | getDestdir()
Get the destination directory. |
boolean | getFailonerror()
Gets the failonerror flag. |
String | getIeplugin()
Get the IE CLASSID value. |
String | getPackage()
Get the name of the package. |
Path | getSrcDir()
Get the source dir. |
File | getUribase()
Get the uri base value. |
File | getUriroot()
Get the uri root value. |
int | getVerbose()
Get the verbose level. |
JspC.WebAppParameter | getWebApp()
Get the web app. |
File | getWebinc()
Get the webinc attribute. |
File | getWebxml()
Filename for web.xml. |
boolean | isMapped()
If true, generate separate write() calls for each HTML line
in the JSP. |
protected File | mapToJavaFile(JspMangler mangler, File srcFile, File srcDir, File dest)
get a filename from our jsp file. |
protected void | resetFileLists()
Clear the list of files to be compiled and copied.. |
protected void | scanDir(File srcDir, File dest, JspMangler mangler, String[] files)
Scans the directory looking for source files to be compiled.
|
void | setClasspath(Path cp)
Set the classpath to be used for this compilation. |
void | setClasspathRef(Reference r)
Adds a reference to a classpath defined elsewhere |
void | setCompiler(String compiler)
Class name of a JSP compiler adapter. |
void | setCompilerclasspath(Path cp)
Set the classpath to be used to find this compiler adapter |
void | setDestdir(File destDir)
Set the destination directory into which the JSP source
files should be compiled. |
void | setFailonerror(boolean fail)
Whether or not the build should halt if compilation fails.
|
void | setIeplugin(String iepluginid)
Java Plugin CLASSID for Internet Explorer |
void | setMapped(boolean mapped)
If true, generate separate write() calls for each HTML line
in the JSP. |
void | setPackage(String pkg)
Set the name of the package the compiled jsp files should be in. |
void | setSrcDir(Path srcDir)
Set the path for source JSP files. |
void | setUribase(File uribase)
The URI context of relative URI references in the JSP pages.
|
void | setUriroot(File uriroot)
The root directory that uri files should be resolved
against. |
void | setVerbose(int i)
Set the verbose level of the compiler |
void | setWebinc(File webinc)
output filename for the fraction of web.xml that lists
servlets. |
void | setWebxml(File webxml)
Filename for web.xml.
|
Parameters: webappParam add a web app parameter
Throws: BuildException if more than one webapp is specified.
Returns: a path to be configured.
Returns: a path to be configured.
Throws: BuildException on error.
Returns: the classpath.
Returns: the list of files.
Returns: the compiler classpath.
Returns: the directory.
Returns: the flag.
Returns: the value.
Returns: the package.
Returns: the source path.
Returns: the value.
Returns: the value.
Returns: the level.
Returns: the web app attribute.
Returns: the webinc attribute.
Returns: The filename for web.xml.
Returns: mapping status
Parameters: mangler the jsp filename managler. srcFile the source file. srcDir the source directory. dest the destination directory.
Returns: the filename.
UNKNOWN: support packages and subdirs
Parameters: srcDir the source directory. dest the destination directory. mangler the jsp filename mangler. files the file names to mangle.
Parameters: cp the path to be used.
Parameters: r a reference to a classpath.
Parameters: compiler the compiler class name.
Parameters: cp the compiler classpath.
Parameters: destDir the destination directory.
true
.Parameters: fail a boolean
value.
Parameters: iepluginid the id to use.
Parameters: mapped a boolean
value.
Parameters: pkg the name of the package.
Parameters: srcDir the source path.
Parameters: uribase The new Uribase value
Parameters: uriroot The new Uribase value
Parameters: i the verbose level to use.
Parameters: webinc The new Webinc value
Parameters: webxml The new Webxml value