/**
* Are we keeping generated code around?
*/
+ @Override
public boolean getKeepGenerated() {
return keepGenerated;
}
/**
* Should white spaces between directives or actions be trimmed?
*/
+ @Override
public boolean getTrimSpaces() {
return trimSpaces;
}
+ @Override
public boolean isPoolingEnabled() {
return isPoolingEnabled;
}
/**
* Are we supporting HTML mapped servlets?
*/
+ @Override
public boolean getMappedFile() {
return mappedFile;
}
/**
* Should class files be compiled with debug information?
*/
+ @Override
public boolean getClassDebugInfo() {
return classDebugInfo;
}
/**
* Background JSP compile thread check interval
*/
+ @Override
public int getCheckInterval() {
return checkInterval;
}
/**
* Modification test interval.
*/
+ @Override
public int getModificationTestInterval() {
return modificationTestInterval;
}
/**
* Re-compile on failure.
*/
+ @Override
public boolean getRecompileOnFail() {
return recompileOnFail;
}
/**
* Is Jasper being used in development mode?
*/
+ @Override
public boolean getDevelopment() {
return development;
}
/**
* Is the generation of SMAP info for JSR45 debugging suppressed?
*/
+ @Override
public boolean isSmapSuppressed() {
return isSmapSuppressed;
}
/**
* Should SMAP info for JSR45 debugging be dumped to a file?
*/
+ @Override
public boolean isSmapDumped() {
return isSmapDumped;
}
/**
* Are Text strings to be generated as char arrays?
*/
+ @Override
public boolean genStringAsCharArray() {
return this.genStringAsCharArray;
}
/**
* Class ID for use in the plugin tag when the browser is IE.
*/
+ @Override
public String getIeClassId() {
return ieClassId;
}
/**
* What is my scratch dir?
*/
+ @Override
public File getScratchDir() {
return scratchDir;
}
* What classpath should I use while compiling the servlets
* generated from JSP files?
*/
+ @Override
public String getClassPath() {
return classpath;
}
/**
* Is generation of X-Powered-By response header enabled/disabled?
*/
+ @Override
public boolean isXpoweredBy() {
return xpoweredBy;
}
/**
* Compiler to use.
*/
+ @Override
public String getCompiler() {
return compiler;
}
/**
* @see Options#getCompilerTargetVM
*/
+ @Override
public String getCompilerTargetVM() {
return compilerTargetVM;
}
/**
* @see Options#getCompilerSourceVM
*/
+ @Override
public String getCompilerSourceVM() {
return compilerSourceVM;
}
/**
* Java compiler class to use.
*/
+ @Override
public String getCompilerClassName() {
return compilerClassName;
}
+ @Override
public boolean getErrorOnUseBeanInvalidClassAttribute() {
return errorOnUseBeanInvalidClassAttribute;
}
errorOnUseBeanInvalidClassAttribute = b;
}
+ @Override
public TldLocationsCache getTldLocationsCache() {
return tldLocationsCache;
}
tldLocationsCache = tldC;
}
+ @Override
public String getJavaEncoding() {
return javaEncoding;
}
+ @Override
public boolean getFork() {
return fork;
}
+ @Override
public JspConfig getJspConfig() {
return jspConfig;
}
+ @Override
public TagPluginManager getTagPluginManager() {
return tagPluginManager;
}
+ @Override
public boolean isCaching() {
return false;
}
+ @Override
public Map<String, TagLibraryInfo> getCache() {
return null;
}
* Should we include a source fragment in exception messages, which could be displayed
* to the developer ?
*/
+ @Override
public boolean getDisplaySourceFragment() {
return displaySourceFragment;
}
* Should jsps be unloaded if to many are loaded?
* If set to a value greater than 0 eviction of jsps is started. Default: -1
*/
+ @Override
public int getMaxLoadedJsps() {
return maxLoadedJsps;
}
* Should any jsps be unloaded when being idle for this time in seconds?
* If set to a value greater than 0 eviction of jsps is started. Default: -1
*/
+ @Override
public int getJspIdleTimeout() {
return jspIdleTimeout;
}
* In JspC this always returns <code>true</code>.
* {@inheritDoc}
*/
+ @Override
public boolean getKeepGenerated() {
// isn't this why we are running jspc?
return true;
/**
* {@inheritDoc}
*/
+ @Override
public boolean getTrimSpaces() {
return trimSpaces;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean isPoolingEnabled() {
return poolingEnabled;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean isXpoweredBy() {
return xpoweredBy;
}
* In JspC this always returns <code>true</code>.
* {@inheritDoc}
*/
+ @Override
public boolean getDisplaySourceFragment() {
return true;
}
+ @Override
public int getMaxLoadedJsps() {
return -1;
}
+ @Override
public int getJspIdleTimeout() {
return -1;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean getErrorOnUseBeanInvalidClassAttribute() {
return errorOnUseBeanInvalidClassAttribute;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean getMappedFile() {
return mappedFile;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean getClassDebugInfo() {
// compile with debug info
return classDebugInfo;
/**
* {@inheritDoc}
*/
+ @Override
public boolean isCaching() {
return caching;
}
/**
* {@inheritDoc}
*/
+ @Override
public Map<String, TagLibraryInfo> getCache() {
return cache;
}
* In JspC this always returns <code>0</code>.
* {@inheritDoc}
*/
+ @Override
public int getCheckInterval() {
return 0;
}
* In JspC this always returns <code>0</code>.
* {@inheritDoc}
*/
+ @Override
public int getModificationTestInterval() {
return 0;
}
* In JspC this always returns <code>false</code>.
* {@inheritDoc}
*/
+ @Override
public boolean getRecompileOnFail() {
return false;
}
* In JspC this always returns <code>false</code>.
* {@inheritDoc}
*/
+ @Override
public boolean getDevelopment() {
return false;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean isSmapSuppressed() {
return smapSuppressed;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean isSmapDumped() {
return smapDumped;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean genStringAsCharArray() {
return genStringAsCharArray;
}
/**
* {@inheritDoc}
*/
+ @Override
public String getIeClassId() {
return ieClassId;
}
/**
* {@inheritDoc}
*/
+ @Override
public File getScratchDir() {
return scratchDir;
}
/**
* {@inheritDoc}
*/
+ @Override
public String getCompiler() {
return compiler;
}
/**
* {@inheritDoc}
*/
+ @Override
public String getCompilerClassName() {
return null;
}
/**
* {@inheritDoc}
*/
+ @Override
public String getCompilerTargetVM() {
return compilerTargetVM;
}
/**
* {@inheritDoc}
*/
- public String getCompilerSourceVM() {
+ @Override
+ public String getCompilerSourceVM() {
return compilerSourceVM;
}
/**
* {@inheritDoc}
*/
+ @Override
public TldLocationsCache getTldLocationsCache() {
return tldLocationsCache;
}
*
* @return String The encoding
*/
+ @Override
public String getJavaEncoding() {
return javaEncoding;
}
/**
* {@inheritDoc}
*/
+ @Override
public boolean getFork() {
return false;
}
/**
* {@inheritDoc}
*/
+ @Override
public String getClassPath() {
if( classPath != null )
return classPath;
/**
* {@inheritDoc}
*/
+ @Override
public JspConfig getJspConfig() {
return jspConfig;
}
/**
* {@inheritDoc}
*/
+ @Override
public TagPluginManager getTagPluginManager() {
return tagPluginManager;
}
try {
if (f.exists()) {
f = new File(f.getAbsolutePath());
- while (f != null) {
+ while (true) {
File g = new File(f, "WEB-INF");
if (g.exists() && g.isDirectory()) {
uriRoot = f.getCanonicalPath();
* @param errMsg Parse error message
* @param exception Parse exception
*/
+ @Override
public void jspError(String fname, int line, int column, String errMsg,
Exception ex) throws JasperException {
throw new JasperException(fname + "(" + line + "," + column + ")"
* @param errMsg Parse error message
* @param exception Parse exception
*/
+ @Override
public void jspError(String errMsg, Exception ex) throws JasperException {
throw new JasperException(errMsg, ex);
}
* @param details Array of JavacErrorDetail instances corresponding to the
* compilation errors
*/
+ @Override
public void javacError(JavacErrorDetail[] details) throws JasperException {
if (details == null) {
* @param errorReport Compilation error report
* @param exception Compilation exception
*/
+ @Override
public void javacError(String errorReport, Exception exception)
throws JasperException {
private static class PrivilegedGetTccl
implements PrivilegedAction<ClassLoader> {
+ @Override
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
this.jarUrl = jarUrl;
}
+ @Override
public JarFile getJarFile() throws IOException {
URL jarFileUrl = new URL("jar:" + jarUrl + "!/");
JarURLConnection conn = (JarURLConnection) jarFileUrl.openConnection();
return conn.getJarFile();
}
+ @Override
public String getUrl() {
return jarUrl;
}
+ @Override
public URL getEntry(String name) {
try {
return new URL("jar:" + jarUrl + "!/" + name);
/*
* See org.xml.sax.ext.LexicalHandler.
*/
+ @Override
public void comment(char[] buf, int offset, int len) throws SAXException {
processChars(); // Flush char buffer and remove white spaces
/*
* See org.xml.sax.ext.LexicalHandler.
*/
+ @Override
public void startCDATA() throws SAXException {
processChars(); // Flush char buffer and remove white spaces
/*
* See org.xml.sax.ext.LexicalHandler.
*/
+ @Override
public void endCDATA() throws SAXException {
processChars(); // Flush char buffer and remove white spaces
}
/*
* See org.xml.sax.ext.LexicalHandler.
*/
+ @Override
public void startEntity(String name) throws SAXException {
// do nothing
}
/*
* See org.xml.sax.ext.LexicalHandler.
*/
+ @Override
public void endEntity(String name) throws SAXException {
// do nothing
}
/*
* See org.xml.sax.ext.LexicalHandler.
*/
+ @Override
public void startDTD(String name, String publicId, String systemId)
throws SAXException {
if (!isValidating) {
/*
* See org.xml.sax.ext.LexicalHandler.
*/
+ @Override
public void endDTD() throws SAXException {
inDTD = false;
}
pluginAttributes = new HashMap<String, Object>();
}
+ @Override
public TagPluginContext getParentContext() {
Node parent = node.getParent();
if (! (parent instanceof Node.CustomTag)) {
return ((Node.CustomTag) parent).getTagPluginContext();
}
+ @Override
public void setPluginAttribute(String key, Object value) {
pluginAttributes.put(key, value);
}
+ @Override
public Object getPluginAttribute(String key) {
return pluginAttributes.get(key);
}
+ @Override
public boolean isScriptless() {
return node.getChildInfo().isScriptless();
}
+ @Override
public boolean isConstantAttribute(String attribute) {
Node.JspAttribute attr = getNodeAttribute(attribute);
if (attr == null)
return attr.isLiteral();
}
+ @Override
public String getConstantAttribute(String attribute) {
Node.JspAttribute attr = getNodeAttribute(attribute);
if (attr == null)
return attr.getValue();
}
+ @Override
public boolean isAttributeSpecified(String attribute) {
return getNodeAttribute(attribute) != null;
}
+ @Override
public String getTemporaryVariableName() {
return node.getRoot().nextTemporaryVariableName();
}
+ @Override
public void generateImport(String imp) {
pageInfo.addImport(imp);
}
+ @Override
public void generateDeclaration(String id, String text) {
if (pageInfo.isPluginDeclared(id)) {
return;
curNodes.add(new Node.Declaration(text, node.getStart(), null));
}
+ @Override
public void generateJavaSource(String sourceCode) {
curNodes.add(new Node.Scriptlet(sourceCode, node.getStart(),
null));
}
+ @Override
public void generateAttribute(String attributeName) {
curNodes.add(new Node.AttributeGenerator(node.getStart(),
attributeName,
node));
}
+ @Override
public void dontUseTagPlugin() {
node.setUseTagPlugin(false);
}
+ @Override
public void generateBody() {
// Since we'll generate the body anyway, this is really a nop,
// except for the fact that it lets us put the Java sources the
return this.target.isLiteralText();
}
+ @Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeUTF(this.mark);
out.writeObject(this.target);
}
+ @Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.mark = in.readUTF();
return this.target.isLiteralText();
}
+ @Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeUTF(this.mark);
out.writeObject(this.target);
}
+ @Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.mark = in.readUTF();
this.ctx = ctx;
}
+ @Override
public Object resolveVariable(String pName) throws ELException {
return this.ctx.getELResolver().getValue(this.ctx, null, pName);
}
_jspService(request, response);
}
+ @Override
public void jspInit() {
}
public void _jspInit() {
}
+ @Override
public void jspDestroy() {
}
protected void _jspDestroy() {
}
+ @Override
public abstract void _jspService(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException;
}
+ @Override
public void addELContextListener(ELContextListener listener) {
if (listener == null) {
throw new IllegalArgumentException("ELConextListener was null");
if (Constants.IS_SECURITY_ENABLED) {
ctx = AccessController.doPrivileged(
new PrivilegedAction<ELContextImpl>() {
+ @Override
public ELContextImpl run() {
return new ELContextImpl(r);
}
return this.resolver;
}
+ @Override
public void addELResolver(ELResolver resolver) throws IllegalStateException {
if (resolver == null) {
throw new IllegalArgumentException("ELResolver was null");
this.resolvers.add(resolver);
}
+ @Override
public ExpressionFactory getExpressionFactory() {
return expressionFactory;
}
/**
* VariableResolver interface
*/
+ @Override
@Deprecated
public Object resolveVariable(String pName) throws ELException {
ELContext ctx = this.getELContext();
this.autoflush = autoflush;
}
+ @Override
public PageContext run() {
return factory.internalGetPageContext(servlet, request, response,
errorPageURL, needsSession, bufferSize, autoflush);
this.pageContext = pageContext;
}
+ @Override
public Void run() {
factory.internalReleasePageContext(pageContext);
return null;
if (Constants.IS_SECURITY_ENABLED) {
return AccessController.doPrivileged(
new PrivilegedAction<JspApplicationContext>() {
+ @Override
public JspApplicationContext run() {
return JspApplicationContextImpl.getInstance(context);
}
this.ignoreMethodNF = ignoreMethodNF;
}
+ @Override
public Void run() throws JasperException {
internalIntrospecthelper(
bean,prop,value,request,param,ignoreMethodNF);
private String getLocalizeMessage(final String message){
if (SecurityUtil.isPackageProtectionEnabled()){
return AccessController.doPrivileged(new PrivilegedAction<String>(){
+ @Override
public String run(){
return Localizer.getMessage(message);
}
if (SecurityUtil.isPackageProtectionEnabled()) {
return AccessController.doPrivileged(
new PrivilegedAction<Object>() {
+ @Override
public Object run() {
return doGetAttribute(name);
}
if (SecurityUtil.isPackageProtectionEnabled()) {
return AccessController.doPrivileged(
new PrivilegedAction<Object>() {
+ @Override
public Object run() {
return doGetAttribute(name, scope);
}
if (SecurityUtil.isPackageProtectionEnabled()) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
public Void run() {
doSetAttribute(name, attribute);
return null;
if (SecurityUtil.isPackageProtectionEnabled()) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
public Void run() {
doSetAttribute(name, o, scope);
return null;
}
if (SecurityUtil.isPackageProtectionEnabled()) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
public Void run() {
doRemoveAttribute(name, scope);
return null;
if (SecurityUtil.isPackageProtectionEnabled()) {
return (AccessController
.doPrivileged(new PrivilegedAction<Integer>() {
+ @Override
public Integer run() {
return new Integer(doGetAttributeScope(name));
}
if (SecurityUtil.isPackageProtectionEnabled()) {
return AccessController.doPrivileged(
new PrivilegedAction<Object>() {
+ @Override
public Object run() {
if (name == null) {
throw new NullPointerException(Localizer
if (SecurityUtil.isPackageProtectionEnabled()) {
return AccessController.doPrivileged(
new PrivilegedAction<Enumeration<String>>() {
+ @Override
public Enumeration<String> run() {
return doGetAttributeNamesInScope(scope);
}
if (SecurityUtil.isPackageProtectionEnabled()) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
public Void run() {
doRemoveAttribute(name);
return null;
try {
AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() {
+ @Override
public Void run() throws Exception {
doInclude(relativeUrlPath, flush);
return null;
try {
AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() {
+ @Override
public Void run() throws Exception {
doForward(relativeUrlPath);
return null;
try {
AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() {
+ @Override
public Void run() throws Exception {
doHandlePageException(t);
return null;
retValue = AccessController
.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
if (SecurityUtil.isPackageProtectionEnabled()) {
funcMapper = AccessController.doPrivileged(
new PrivilegedAction<ProtectedFunctionMapper>() {
+ @Override
public ProtectedFunctionMapper run() {
return new ProtectedFunctionMapper();
}
try {
method = AccessController.doPrivileged(
new PrivilegedExceptionAction<Method>() {
+ @Override
public Method run() throws Exception {
return c.getDeclaredMethod(methodName, args);
}
if (SecurityUtil.isPackageProtectionEnabled()) {
funcMapper = AccessController.doPrivileged(
new PrivilegedAction<ProtectedFunctionMapper>() {
+ @Override
public ProtectedFunctionMapper run() {
return new ProtectedFunctionMapper();
}
try {
method = AccessController.doPrivileged(
new PrivilegedExceptionAction<Method>() {
+ @Override
public Method run() throws Exception {
return c.getDeclaredMethod(methodName, args);
}
public class Catch implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
//flag for the existence of the var attribute
public final class Choose implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
// Not much to do here, much of the work will be done in the
private boolean hasVar, hasBegin, hasEnd, hasStep;
+ @Override
public void doTag(TagPluginContext ctxt) {
String index = null;
public class ForTokens implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
boolean hasVar, hasVarStatus, hasBegin, hasEnd, hasStep;
public final class If implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
String condV = ctxt.getTemporaryVariableName();
ctxt.generateJavaSource("boolean " + condV + "=");
public class Import implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
boolean hasContext, hasVar, hasScope, hasVarReader, hasCharEncoding;
public final class Otherwise implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
// See When.java for the reason whey "}" is need at the beginng and
public final class Out implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
//these two data member are to indicate
public class Param implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
//don't support the body content
public class Redirect implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
//flag for the existence of the "context"
public class Remove implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
//scope flag
public class Set implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
//the flags to indicate whether the attributes have been specified
public class Url implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
//flags
public final class When implements TagPlugin {
+ @Override
public void doTag(TagPluginContext ctxt) {
// Get the parent context to determine if this is the first <c:when>
TagPluginContext parentContext = ctxt.getParentContext();
class MyEntityResolver implements EntityResolver {
+ @Override
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException {
for (int i = 0; i < Constants.CACHED_DTD_PUBLIC_IDS.size(); i++) {
class MyErrorHandler implements ErrorHandler {
+ @Override
public void warning(SAXParseException ex) throws SAXException {
Log log = LogFactory.getLog(MyErrorHandler.class);
if (log.isDebugEnabled())
// We ignore warnings
}
+ @Override
public void error(SAXParseException ex) throws SAXException {
throw ex;
}
+ @Override
public void fatalError(SAXParseException ex) throws SAXException {
throw ex;
}