public class XJspCompiler extends JDTCompiler
To make this compiler work the following is required:
Modifier and Type | Field and Description |
---|---|
private java.io.File |
extensionsJar |
private boolean |
isXJsp |
private long |
lastModified |
private Log |
log |
private static java.util.regex.Pattern |
PATH_MATCH
Path to JSP must match: /extensions/[jar-file-name]/[jsp-path].xjsp
group(1) = JAR name, group(2) = JSP path
|
private java.io.File |
pluginsDir |
static java.lang.String |
RESOURCES_URL
The location where the extensions resources are extracted.
|
Constructor and Description |
---|
XJspCompiler() |
Modifier and Type | Method and Description |
---|---|
protected void |
generateClass(java.lang.String[] smap)
Called when a JSP page needs recompiling.
|
protected java.net.URLClassLoader |
getExtensionClassLoader()
Get a class loader that can load classes from the current web application
as well as the extensions JAR file.
|
protected java.io.File |
getPluginsDir()
Get the path to the plug-in directory from BASE.
|
protected java.lang.ClassLoader |
getWebAppClassLoader()
Get the class loader for the web application this JSP is
located in.
|
void |
init(JspCompilationContext ctxt,
JspServletWrapper jsw)
Initialises the compiler.
|
boolean |
isOutDated(boolean checkClass)
Checks if the extensions JAR file has been modified.
|
protected void |
setContextClassLoader()
Sets the context class loader if this JSP page is an
extension JSP page and if the extensions JAR file has been
modified since the last time the class loader was set.
|
compile, compile, compile, generateJava, getCompilationContext, getErrorDispatcher, getPageInfo, getPageNodes, isOutDated, removeGeneratedClassFiles, removeGeneratedFiles
public static final java.lang.String RESOURCES_URL
private static final java.util.regex.Pattern PATH_MATCH
private final Log log
private java.io.File pluginsDir
private boolean isXJsp
private java.io.File extensionsJar
private long lastModified
public void init(JspCompilationContext ctxt, JspServletWrapper jsw)
protected void generateClass(java.lang.String[] smap) throws java.io.FileNotFoundException, JasperException, java.lang.Exception
generateClass
in class JDTCompiler
java.io.FileNotFoundException
JasperException
java.lang.Exception
public boolean isOutDated(boolean checkClass)
isOutDated
in class Compiler
protected void setContextClassLoader() throws java.lang.Exception
java.lang.Exception
protected java.net.URLClassLoader getExtensionClassLoader() throws java.lang.Exception
java.lang.Exception
protected java.lang.ClassLoader getWebAppClassLoader()
protected java.io.File getPluginsDir()