|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jasper.compiler.Compiler org.apache.jasper.compiler.JDTCompiler net.sf.basedb.clients.web.extensions.XJspCompiler
public class XJspCompiler
Class that enabled compilation of custom JSP pages that are part of an extension that uses classes from the extension JAR file (eg. a JAR file in the /WEB-INF/extensions directory).
To make this compiler work the following is required:
Field Summary | |
---|---|
static String |
EXTENSIONS_URL
The location where the extension system is looking for extensions. |
private File |
extensionsJar
|
private boolean |
isXJsp
|
private long |
lastModified
|
private static Pattern |
PATH_MATCH
Path to JSP must match: /extensions/[jar-file-name]/[jsp-path].xjsp group(1) = JAR name, group(2) = JSP path |
static String |
RESOURCES_URL
The location where the extensions resources are extracted. |
Fields inherited from class org.apache.jasper.compiler.Compiler |
---|
ctxt, errDispatcher, jsw, log, options, pageInfo, pageNodes, tfp |
Constructor Summary | |
---|---|
XJspCompiler()
|
Method Summary | |
---|---|
protected void |
generateClass(String[] smap)
Called when a JSP page needs recompiling. |
protected URLClassLoader |
getExtensionClassLoader()
Get a class loader that can load classes from the current web application as well as the extensions JAR file. |
protected 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. |
Methods inherited from class org.apache.jasper.compiler.Compiler |
---|
compile, compile, compile, generateJava, getCompilationContext, getErrorDispatcher, getPageInfo, getPageNodes, isOutDated, removeGeneratedClassFiles, removeGeneratedFiles |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXTENSIONS_URL
public static final String RESOURCES_URL
private static final Pattern PATH_MATCH
private boolean isXJsp
private File extensionsJar
private long lastModified
Constructor Detail |
---|
public XJspCompiler()
Method Detail |
---|
public void init(JspCompilationContext ctxt, JspServletWrapper jsw)
init
in class Compiler
protected void generateClass(String[] smap) throws FileNotFoundException, JasperException, Exception
generateClass
in class JDTCompiler
FileNotFoundException
JasperException
Exception
public boolean isOutDated(boolean checkClass)
isOutDated
in class Compiler
protected void setContextClassLoader() throws Exception
Exception
protected URLClassLoader getExtensionClassLoader() throws Exception
Exception
protected ClassLoader getWebAppClassLoader()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |