*/\r
private boolean xpoweredBy;\r
\r
+ /**\r
+ * Should annotations be ignored?\r
+ */\r
+ private boolean ignoreAnnotations = false;\r
+ \r
public String getProperty(String name ) {\r
return settings.getProperty( name );\r
}\r
}\r
\r
/**\r
+ * Should annotations on tags be ignored?\r
+ */\r
+ public boolean getIgnoreAnnotations() {\r
+ return ignoreAnnotations;\r
+ }\r
+\r
+ /**\r
* Is the generation of SMAP info for JSR45 debuggin suppressed?\r
*/\r
public boolean isSmapSuppressed() {\r
String validating=config.getInitParameter( "validating");\r
if( "false".equals( validating )) ParserUtils.validating=false;\r
\r
+ String annotations = config.getInitParameter("org.apache.jasper.IGNORE_ANNOTATIONS");\r
+ if ("true".equals(annotations)) {\r
+ ignoreAnnotations = true;\r
+ }\r
+\r
String keepgen = config.getInitParameter("keepgenerated");\r
if (keepgen != null) {\r
if (keepgen.equalsIgnoreCase("true")) {\r
private boolean smapSuppressed = true;\r
private boolean smapDumped = false;\r
private boolean caching = true;\r
+ private boolean ignoreAnnotations = false;\r
private Map cache = new HashMap();\r
\r
private String compiler = null;\r
compilerSourceVM = vm;\r
}\r
\r
+ /**\r
+ * Should annotations on tags be ignored?\r
+ */\r
+ public boolean getIgnoreAnnotations() {\r
+ return ignoreAnnotations;\r
+ }\r
+\r
+ /**\r
+ * Should annotations on tags be ignored?\r
+ */\r
+ public void setIgnoreAnnotations(boolean ignoreAnnotations) {\r
+ this.ignoreAnnotations = ignoreAnnotations;\r
+ }\r
+\r
public TldLocationsCache getTldLocationsCache() {\r
return tldLocationsCache;\r
}\r
public boolean getTrimSpaces();\r
\r
/**\r
+ * Should annotations on tags be ignored?\r
+ */\r
+ public boolean getIgnoreAnnotations();\r
+\r
+ /**\r
* Class ID for use in the plugin tag when the browser is IE. \r
*/\r
public String getIeClassId();\r
out.print("new ");\r
out.print(tagHandlerClassName);\r
out.println("();");\r
- out.printin("org.apache.jasper.runtime.AnnotationProcessor.postConstruct(");\r
- out.print(tagHandlerVar);\r
- out.println(");");\r
+ if (!ctxt.getOptions().getIgnoreAnnotations()) {\r
+ out.printin("org.apache.jasper.runtime.AnnotationProcessor.postConstruct(");\r
+ out.print(tagHandlerVar);\r
+ out.println(");");\r
+ }\r
}\r
\r
// includes setting the context\r
} else {\r
out.printin(tagHandlerVar);\r
out.println(".release();");\r
- out.printil("try {");\r
- out.pushIndent();\r
- out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");\r
- out.print(tagHandlerVar);\r
- out.println(");");\r
- out.popIndent();\r
- out.printil("} catch (Exception e) {");\r
- out.pushIndent();\r
- out.printin("log(\"Error processing preDestroy on tag instance of \" +");\r
- out.print(tagHandlerVar);\r
- out.println(".getClass().getName());");\r
- out.popIndent();\r
- out.printil("}");\r
+ if (!ctxt.getOptions().getIgnoreAnnotations()) {\r
+ out.printil("try {");\r
+ out.pushIndent();\r
+ out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");\r
+ out.print(tagHandlerVar);\r
+ out.println(");");\r
+ out.popIndent();\r
+ out.printil("} catch (Exception e) {");\r
+ out.pushIndent();\r
+ out.printin("log(\"Error processing preDestroy on tag instance of \" +");\r
+ out.print(tagHandlerVar);\r
+ out.println(".getClass().getName());");\r
+ out.popIndent();\r
+ out.printil("}");\r
+ }\r
}\r
}\r
if (isTagFile || isFragment) {\r
} else {\r
out.printin(tagHandlerVar);\r
out.println(".release();");\r
- out.printil("try {");\r
- out.pushIndent();\r
- out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");\r
- out.print(tagHandlerVar);\r
- out.println(");");\r
- out.popIndent();\r
- out.printil("} catch (Exception e) {");\r
- out.pushIndent();\r
- out.printin("log(\"Error processing preDestroy on tag instance of \" +");\r
- out.print(tagHandlerVar);\r
- out.println(".getClass().getName());");\r
- out.popIndent();\r
- out.printil("}");\r
+ if (!ctxt.getOptions().getIgnoreAnnotations()) {\r
+ out.printil("try {");\r
+ out.pushIndent();\r
+ out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");\r
+ out.print(tagHandlerVar);\r
+ out.println(");");\r
+ out.popIndent();\r
+ out.printil("} catch (Exception e) {");\r
+ out.pushIndent();\r
+ out.printin("log(\"Error processing preDestroy on tag instance of \" +");\r
+ out.print(tagHandlerVar);\r
+ out.println(".getClass().getName());");\r
+ out.popIndent();\r
+ out.printil("}");\r
+ }\r
}\r
\r
if (n.implementsTryCatchFinally()) {\r
out.println("();");\r
\r
// Resource injection\r
- out.printin("org.apache.jasper.runtime.AnnotationProcessor.postConstruct(");\r
- out.print(tagHandlerVar);\r
- out.println(");");\r
+ if (!ctxt.getOptions().getIgnoreAnnotations()) {\r
+ out.printin("org.apache.jasper.runtime.AnnotationProcessor.postConstruct(");\r
+ out.print(tagHandlerVar);\r
+ out.println(");");\r
+ }\r
\r
generateSetters(n, tagHandlerVar, handlerInfo, true);\r
\r
syncScriptingVars(n, VariableInfo.AT_END);\r
\r
// Resource injection\r
- out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");\r
- out.print(tagHandlerVar);\r
- out.println(");");\r
+ if (!ctxt.getOptions().getIgnoreAnnotations()) {\r
+ out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");\r
+ out.print(tagHandlerVar);\r
+ out.println(");");\r
+ }\r
\r
n.setEndJavaLine(out.getJavaLine());\r
}\r
\r
// index of next available tag handler\r
private int current;\r
+ private boolean ignoreAnnotations = false;\r
\r
public static TagHandlerPool getTagHandlerPool( ServletConfig config) {\r
TagHandlerPool result=null;\r
}\r
this.handlers = new Tag[maxSize];\r
this.current = -1;\r
+ String annotations = getOption(config, "org.apache.jasper.IGNORE_ANNOTATIONS", null);\r
+ if ("true".equals(annotations)) {\r
+ ignoreAnnotations = true;\r
+ }\r
}\r
\r
/**\r
// wait for us to construct a tag for this thread.\r
try {\r
Tag instance = (Tag) handlerClass.newInstance();\r
- AnnotationProcessor.postConstruct(instance);\r
+ if (!ignoreAnnotations) {\r
+ AnnotationProcessor.postConstruct(instance);\r
+ }\r
return instance;\r
} catch (Exception e) {\r
throw new JspException(e.getMessage(), e);\r
}\r
// There is no need for other threads to wait for us to release\r
handler.release();\r
- try {\r
- AnnotationProcessor.preDestroy(handler);\r
- } catch (Exception e) {\r
- log.warn("Error processing preDestroy on tag instance of " \r
- + handler.getClass().getName(), e);\r
+ if (!ignoreAnnotations) {\r
+ try {\r
+ AnnotationProcessor.preDestroy(handler);\r
+ } catch (Exception e) {\r
+ log.warn("Error processing preDestroy on tag instance of " \r
+ + handler.getClass().getName(), e);\r
+ }\r
}\r
}\r
\r
public synchronized void release() {\r
for (int i = current; i >= 0; i--) {\r
handlers[i].release();\r
- try {\r
- AnnotationProcessor.preDestroy(handlers[i]);\r
- } catch (Exception e) {\r
- log.warn("Error processing preDestroy on tag instance of " \r
- + handlers[i].getClass().getName(), e);\r
+ if (!ignoreAnnotations) {\r
+ try {\r
+ AnnotationProcessor.preDestroy(handlers[i]);\r
+ } catch (Exception e) {\r
+ log.warn("Error processing preDestroy on tag instance of " \r
+ + handlers[i].getClass().getName(), e);\r
+ }\r
}\r
}\r
}\r