Author: remy.maucherat(a)jboss.com
Date: 2008-10-20 06:42:51 -0400 (Mon, 20 Oct 2008)
New Revision: 812
Modified:
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
trunk/java/org/apache/jasper/compiler/Generator.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/config/context.xml
trunk/webapps/docs/config/host.xml
Log:
- More EL fixes (joy) :)
- Fix default names for annotations lookups when a superclass has the annotation.
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-10-17 14:03:57 UTC
(rev 811)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-10-20 10:42:51 UTC
(rev 812)
@@ -382,16 +382,14 @@
Response response)
throws Exception {
- // XXX the processor needs to set a correct scheme and port prior to this point,
- // in ajp13 protocols dont make sense to get the port from the connector..
- // XXX the processor may have set a correct scheme and port prior to this point,
- // in ajp13 protocols dont make sense to get the port from the connector...
+ // FIXME: The processor needs to set a correct scheme and port prior to this
point,
+ // in ajp13 protocol does not make sense to get the port from the connector..
// otherwise, use connector configuration
if (! req.scheme().isNull()) {
// use processor specified scheme to determine secure state
request.setSecure(req.scheme().equals("https"));
} else {
- // use connector scheme and secure configuration, (defaults to
+ // Use connector scheme and secure configuration, (defaults to
// "http" and false respectively)
req.scheme().setString(connector.getScheme());
request.setSecure(connector.getSecure());
Modified: trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
===================================================================
--- trunk/java/org/apache/catalina/core/DefaultInstanceManager.java 2008-10-17 14:03:57
UTC (rev 811)
+++ trunk/java/org/apache/catalina/core/DefaultInstanceManager.java 2008-10-20 10:42:51
UTC (rev 812)
@@ -50,7 +50,7 @@
import org.apache.catalina.util.StringManager;
/**
- * @version $Rev$ $Date$
+ * @version $Rev:$ $Date:$
*/
public class DefaultInstanceManager implements InstanceManager {
@@ -112,12 +112,12 @@
}
public Object newInstance(String className) throws IllegalAccessException,
InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException
{
- Class clazz = loadClassMaybePrivileged(className, classLoader);
+ Class<?> clazz = loadClassMaybePrivileged(className, classLoader);
return newInstance(clazz.newInstance(), clazz);
}
public Object newInstance(final String className, final ClassLoader classLoader)
throws IllegalAccessException, NamingException, InvocationTargetException,
InstantiationException, ClassNotFoundException {
- Class clazz = classLoader.loadClass(className);
+ Class<?> clazz = classLoader.loadClass(className);
return newInstance(clazz.newInstance(), clazz);
}
@@ -126,7 +126,7 @@
newInstance(o, o.getClass());
}
- private Object newInstance(Object instance, Class clazz) throws
IllegalAccessException, InvocationTargetException, NamingException {
+ private Object newInstance(Object instance, Class<?> clazz) throws
IllegalAccessException, InvocationTargetException, NamingException {
if (!ignoreAnnotations) {
Map<String, String> injections = injectionMap.get(clazz.getName());
processAnnotations(instance, injections);
@@ -150,9 +150,9 @@
* @throws java.lang.reflect.InvocationTargetException
* if call fails
*/
- protected void postConstruct(Object instance, Class clazz)
+ protected void postConstruct(Object instance, Class<?> clazz)
throws IllegalAccessException, InvocationTargetException {
- Class superClass = clazz.getSuperclass();
+ Class<?> superClass = clazz.getSuperclass();
if (superClass != Object.class) {
postConstruct(instance, superClass);
}
@@ -193,9 +193,9 @@
* @throws java.lang.reflect.InvocationTargetException
* if call fails
*/
- protected void preDestroy(Object instance, Class clazz)
+ protected void preDestroy(Object instance, Class<?> clazz)
throws IllegalAccessException, InvocationTargetException {
- Class superClass = clazz.getSuperclass();
+ Class<?> superClass = clazz.getSuperclass();
if (superClass != Object.class) {
preDestroy(instance, superClass);
}
@@ -252,25 +252,31 @@
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
if (injections != null &&
injections.containsKey(field.getName())) {
- lookupFieldResource(context, instance, field,
injections.get(field.getName()));
+ lookupFieldResource(context, instance, field,
+ injections.get(field.getName()), clazz);
} else if (field.isAnnotationPresent(Resource.class)) {
Resource annotation = field.getAnnotation(Resource.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(EJB.class)) {
EJB annotation = field.getAnnotation(EJB.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(WebServiceRef.class)) {
WebServiceRef annotation =
field.getAnnotation(WebServiceRef.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(PersistenceContext.class)) {
PersistenceContext annotation =
field.getAnnotation(PersistenceContext.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(PersistenceUnit.class)) {
PersistenceUnit annotation =
field.getAnnotation(PersistenceUnit.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
}
}
@@ -281,28 +287,34 @@
if (injections != null && methodName.startsWith("set")
&& methodName.length() > 3) {
String fieldName = Character.toLowerCase(methodName.charAt(3)) +
methodName.substring(4);
if (injections.containsKey(fieldName)) {
- lookupMethodResource(context, instance, method,
injections.get(fieldName));
+ lookupMethodResource(context, instance, method,
+ injections.get(fieldName), clazz);
break;
}
}
if (method.isAnnotationPresent(Resource.class)) {
Resource annotation = method.getAnnotation(Resource.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(EJB.class)) {
EJB annotation = method.getAnnotation(EJB.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(WebServiceRef.class)) {
WebServiceRef annotation =
method.getAnnotation(WebServiceRef.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(PersistenceContext.class)) {
PersistenceContext annotation =
method.getAnnotation(PersistenceContext.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(PersistenceUnit.class)) {
PersistenceUnit annotation =
method.getAnnotation(PersistenceUnit.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
}
}
clazz = clazz.getSuperclass();
@@ -311,13 +323,13 @@
}
- protected Class loadClassMaybePrivileged(final String className, final ClassLoader
classLoader) throws ClassNotFoundException {
- Class clazz;
+ protected Class<?> loadClassMaybePrivileged(final String className, final
ClassLoader classLoader) throws ClassNotFoundException {
+ Class<?> clazz;
if (SecurityUtil.isPackageProtectionEnabled()) {
try {
- clazz = AccessController.doPrivileged(new
PrivilegedExceptionAction<Class>() {
+ clazz = AccessController.doPrivileged(new
PrivilegedExceptionAction<Class<?>>() {
- public Class run() throws Exception {
+ public Class<?> run() throws Exception {
return loadClass(className, classLoader);
}
});
@@ -335,12 +347,12 @@
return clazz;
}
- protected Class loadClass(String className, ClassLoader classLoader) throws
ClassNotFoundException {
- if (className.startsWith("org.apache.catalina") ||
className.startsWith("org.jboss.web")) {
+ protected Class<?> loadClass(String className, ClassLoader classLoader) throws
ClassNotFoundException {
+ if (className.startsWith("org.apache.catalina")) {
return containerClassLoader.loadClass(className);
}
try {
- Class clazz = containerClassLoader.loadClass(className);
+ Class<?> clazz = containerClassLoader.loadClass(className);
if (ContainerServlet.class.isAssignableFrom(clazz)) {
return clazz;
}
@@ -350,7 +362,7 @@
return classLoader.loadClass(className);
}
- private void checkAccess(Class clazz) {
+ private void checkAccess(Class<?> clazz) {
if (privileged) return;
if (Filter.class.isAssignableFrom(clazz)) {
checkAccess(clazz, restrictedFilters);
@@ -361,10 +373,10 @@
}
}
- private void checkAccess(Class clazz, Properties restricted) {
+ private void checkAccess(Class<?> clazz, Properties restricted) {
while (clazz != null) {
if ("restricted".equals(restricted.getProperty(clazz.getName())))
{
- throw new SecurityException("Restricted class: " +
clazz.getName());
+ throw new SecurityException("Restricted class" + clazz);
}
clazz = clazz.getSuperclass();
}
@@ -378,11 +390,12 @@
* @param instance object to inject into
* @param field field target for injection
* @param name jndi name value is bound under
+ * @param clazz class annotation is defined in
* @throws IllegalAccessException if field is inaccessible
* @throws javax.naming.NamingException if value is not accessible in naming context
*/
protected static void lookupFieldResource(Context context,
- Object instance, Field field, String name)
+ Object instance, Field field, String name, Class<?> clazz)
throws NamingException, IllegalAccessException {
Object lookedupResource;
@@ -392,7 +405,8 @@
(name.length() > 0)) {
lookedupResource = context.lookup(name);
} else {
- lookedupResource = context.lookup(instance.getClass().getName() +
"/" + field.getName());
+ lookedupResource =
+ context.lookup(clazz.getName() + "/" + field.getName());
}
accessibility = field.isAccessible();
@@ -408,13 +422,14 @@
* @param instance object to inject into
* @param method field target for injection
* @param name jndi name value is bound under
+ * @param clazz class annotation is defined in
* @throws IllegalAccessException if method is inaccessible
* @throws javax.naming.NamingException if value is not accessible in naming context
* @throws java.lang.reflect.InvocationTargetException
* if setter call fails
*/
protected static void lookupMethodResource(Context context,
- Object instance, Method method, String name)
+ Object instance, Method method, String name, Class<?> clazz)
throws NamingException, IllegalAccessException, InvocationTargetException {
if (!method.getName().startsWith("set")
@@ -430,8 +445,8 @@
(name.length() > 0)) {
lookedupResource = context.lookup(name);
} else {
- lookedupResource =
- context.lookup(instance.getClass().getName() + "/" +
method.getName().substring(3));
+ lookedupResource = context.lookup(
+ clazz.getName() + "/" + method.getName().substring(3));
}
accessibility = method.isAccessible();
Modified: trunk/java/org/apache/jasper/compiler/Generator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Generator.java 2008-10-17 14:03:57 UTC (rev
811)
+++ trunk/java/org/apache/jasper/compiler/Generator.java 2008-10-20 10:42:51 UTC (rev
812)
@@ -48,20 +48,20 @@
/**
* Generate Java source from Nodes
- *
+ *
* @author Anil K. Vijendran
* @author Danno Ferrin
* @author Mandar Raje
* @author Rajiv Mordani
* @author Pierre Delisle
- *
+ *
* Tomcat 4.1.x and Tomcat 5:
* @author Kin-man Chung
* @author Jan Luehe
* @author Shawn Bayern
* @author Mark Roth
* @author Denis Benoit
- *
+ *
* Tomcat 6.x
* @author Jacob Hookom
* @author Remy Maucherat
@@ -71,7 +71,7 @@
private static final Class[] OBJECT_CLASS = { Object.class };
- private static final String VAR_EXPRESSIONFACTORY =
+ private static final String VAR_EXPRESSIONFACTORY =
System.getProperty("org.apache.jasper.compiler.Generator.VAR_EXPRESSIONFACTORY",
"_el_expressionfactory");
private static final String VAR_INSTANCEMANAGER =
System.getProperty("org.apache.jasper.compiler.Generator.VAR_INSTANCEMANAGER",
"_jsp_instancemanager");
@@ -186,7 +186,7 @@
/*
* Generates getServletInfo() method that returns the value of the
* page directive's 'info' attribute, if present.
- *
+ *
* The Validator has already ensured that if the translation unit
* contains more than one page directive with an 'info' attribute,
* their values match.
@@ -251,7 +251,7 @@
/*
* Constructor
- *
+ *
* @param v Vector of tag handler pool names to populate
*/
TagHandlerPoolVisitor(Vector v) {
@@ -280,7 +280,7 @@
/*
* Creates the name of the tag handler pool whose tag handlers may
* be (re)used to service this action.
- *
+ *
* @return The name of the tag handler pool
*/
private String createTagHandlerPoolName(String prefix,
@@ -379,7 +379,7 @@
* Generates the _jspInit() method for instantiating the tag handler pools.
* For tag file, _jspInit has to be invoked manually, and the ServletConfig
* object explicitly passed.
- *
+ *
* In JSP 2.1, we also instantiate an ExpressionFactory
*/
private void generateInit() {
@@ -403,7 +403,7 @@
out.println(");");
}
}
-
+
out.printin(VAR_EXPRESSIONFACTORY);
out.print(" = _jspxFactory.getJspApplicationContext(");
if (ctxt.isTagFile()) {
@@ -435,14 +435,14 @@
out.printil("public void _jspDestroy() {");
out.pushIndent();
-
+
if (isPoolingEnabled) {
for (int i = 0; i < tagHandlerPoolNames.size(); i++) {
out.printin((String) tagHandlerPoolNames.elementAt(i));
out.println(".release();");
}
}
-
+
out.popIndent();
out.printil("}");
out.println();
@@ -509,7 +509,7 @@
* Declare tag handler pools (tags of the same type and with the same
* attribute set share the same tag handler pool) (shared by servlet and tag
* handler preamble generation)
- *
+ *
* In JSP 2.1, we also scope an instance of ExpressionFactory
*/
private void genPreambleClassVariableDeclarations(String className)
@@ -542,7 +542,7 @@
out.popIndent();
out.printil("}");
out.println();
-
+
generateInit();
generateDestroy();
}
@@ -784,7 +784,7 @@
* interpreter. If the result is a Named Attribute we insert the
* generated variable name. Otherwise the result is a string literal,
* quoted and escaped.
- *
+ *
* @param attr
* An JspAttribute object
* @param encode
@@ -806,8 +806,8 @@
}
return v;
} else if (attr.isELInterpreterInput()) {
- v = JspUtil.interpreterCall(this.isTagFile, v, expectedType,
- attr.getEL().getMapName(), false);
+ v = attributeValueWithEL(this.isTagFile, v, expectedType,
+ attr.getEL().getMapName());
if (encode) {
return
"org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("
+ v + ", request.getCharacterEncoding())";
@@ -824,10 +824,72 @@
}
}
+
+ /*
+ * When interpreting the EL attribute value, literals outside the EL
+ * must not be unescaped but the EL processor will unescape them.
+ * Therefore, make sure only the EL expressions are processed by the EL
+ * processor.
+ */
+ private String attributeValueWithEL(boolean isTag, String tx,
+ Class<?> expectedType, String mapName) {
+ if (tx==null) return null;
+ int size = tx.length();
+ StringBuffer output = new StringBuffer(size);
+ boolean el = false;
+ int i = 0;
+ int mark = 0;
+ char ch;
+
+ while(i < size){
+ ch = tx.charAt(i);
+
+ // Start of an EL expression
+ if (!el && i+1 < size && ch == '$' &&
tx.charAt(i+1)=='{') {
+ if (mark < i) {
+ if (output.length() > 0) {
+ output.append(" + ");
+ }
+ output.append(quote(tx.substring(mark, i)));
+ }
+ mark = i;
+ el = true;
+ i += 2;
+ } else if (ch=='\\' && i+1 < size &&
+ (tx.charAt(i+1)=='$' || tx.charAt(i+1)=='}')) {
+ // Skip an escaped $ or }
+ i += 2;
+ } else if (el && ch=='}') {
+ // End of an EL expression
+ if (output.length() > 0) {
+ output.append(" + ");
+ }
+ output.append(
+ JspUtil.interpreterCall(isTag,
+ tx.substring(mark, i+1), expectedType,
+ mapName, false));
+ mark = i + 1;
+ el = false;
+ ++i;
+ } else {
+ // Nothing to see here - move to next character
+ ++i;
+ }
+ }
+ if (!el && mark < i) {
+ if (output.length() > 0) {
+ output.append(" + ");
+ }
+ output.append(quote(tx.substring(mark, i)));
+ }
+ return output.toString();
+ }
+
+
/**
* Prints the attribute value specified in the param action, in the form
* of name=value string.
- *
+ *
* @param n
* the parent node for the param action nodes.
*/
@@ -2228,43 +2290,43 @@
}
private void writeNewInstance(String tagHandlerVar, String tagHandlerClassName)
{
- if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
- out.printin(tagHandlerClassName);
- out.print(" ");
- out.print(tagHandlerVar);
- out.print(" = (");
- out.print(tagHandlerClassName);
- out.print(")");
- out.print(VAR_INSTANCEMANAGER);
- out.print(".newInstance(\"");
- out.print(tagHandlerClassName);
- out.println("\", this.getClass().getClassLoader());");
- } else {
- out.printin(tagHandlerClassName);
- out.print(" ");
- out.print(tagHandlerVar);
- out.print(" = (");
- out.print("new ");
- out.print(tagHandlerClassName);
- out.println("());");
+ if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+ out.printin(tagHandlerClassName);
+ out.print(" ");
+ out.print(tagHandlerVar);
+ out.print(" = (");
+ out.print(tagHandlerClassName);
+ out.print(")");
+ out.print(VAR_INSTANCEMANAGER);
+ out.print(".newInstance(\"");
+ out.print(tagHandlerClassName);
+ out.println("\", this.getClass().getClassLoader());");
+ } else {
+ out.printin(tagHandlerClassName);
+ out.print(" ");
+ out.print(tagHandlerVar);
+ out.print(" = (");
+ out.print("new ");
+ out.print(tagHandlerClassName);
+ out.println("());");
if (Constants.INJECT_TAGS) {
- out.printin(VAR_INSTANCEMANAGER);
- out.print(".newInstance(");
- out.print(tagHandlerVar);
- out.println(");");
- }
- }
- }
-
- private void writeDestroyInstance(String tagHandlerVar) {
- if (Constants.INJECT_TAGS) {
out.printin(VAR_INSTANCEMANAGER);
- out.print(".destroyInstance(");
+ out.print(".newInstance(");
out.print(tagHandlerVar);
out.println(");");
}
}
+ }
+ private void writeDestroyInstance(String tagHandlerVar) {
+ if (Constants.INJECT_TAGS) {
+ out.printin(VAR_INSTANCEMANAGER);
+ out.print(".destroyInstance(");
+ out.print(tagHandlerVar);
+ out.println(");");
+ }
+ }
+
private void generateCustomEnd(Node.CustomTag n, String tagHandlerVar,
String tagEvalVar, String tagPushBodyCountVar) {
@@ -2497,7 +2559,7 @@
/*
* This method is called as part of the custom tag's start element.
- *
+ *
* If the given custom tag has a custom nesting level greater than 0,
* save the current values of its scripting variables to temporary
* variables, so those values may be restored in the tag's end element.
@@ -2559,7 +2621,7 @@
/*
* This method is called as part of the custom tag's end element.
- *
+ *
* If the given custom tag has a custom nesting level greater than 0,
* restore its scripting variables to their original values that were
* saved in the tag's start element.
@@ -2764,14 +2826,14 @@
// reset buffer
sb.setLength(0);
-
+
// create our mark
sb.append(n.getStart().toString());
sb.append(" '");
sb.append(attrValue);
- sb.append('\'');
+ sb.append('\'');
String mark = sb.toString();
-
+
// reset buffer
sb.setLength(0);
@@ -2840,8 +2902,8 @@
// run attrValue through the expression interpreter
String mapName = (attr.getEL() != null) ? attr.getEL()
.getMapName() : null;
- attrValue = JspUtil.interpreterCall(this.isTagFile,
- attrValue, c[0], mapName, false);
+ attrValue = attributeValueWithEL(this.isTagFile,
+ attrValue, c[0], mapName);
}
} else {
attrValue = convertString(c[0], attrValue, localName,
@@ -2852,7 +2914,7 @@
/**
* Generate code to create a map for the alias variables
- *
+ *
* @return the name of the map
*/
private String generateAliasMap(Node.CustomTag n, String tagHandlerVar)
@@ -2951,7 +3013,7 @@
for (int i = 0; attrs != null && i < attrs.length; i++) {
String attrValue = evaluateAttribute(handlerInfo, attrs[i], n,
tagHandlerVar);
-
+
Mark m = n.getStart();
out.printil("//
"+m.getFile()+"("+m.getLineNumber()+","+m.getColumnNumber()+")
"+ attrs[i].getTagAttributeInfo());
if (attrs[i].isDynamic()) {
@@ -3116,7 +3178,7 @@
/**
* Generate the code required to obtain the runtime value of the given
* named attribute.
- *
+ *
* @return The name of the temporary variable the result is stored in.
*/
public String generateNamedAttributeValue(Node.NamedAttribute n)
@@ -3167,7 +3229,7 @@
/**
* Similar to generateNamedAttributeValue, but create a JspFragment
* instead.
- *
+ *
* @param n
* The parent node of the named attribute
* @param tagHandlerVar
@@ -3322,7 +3384,7 @@
/**
* The main entry for Generator.
- *
+ *
* @param out
* The servlet output writer
* @param compiler
@@ -3439,7 +3501,7 @@
* share the code generator with JSPs.
*/
out.printil("PageContext _jspx_page_context =
(PageContext)jspContext;");
-
+
// Declare implicit objects.
out.printil("HttpServletRequest request = "
+ "(HttpServletRequest) _jspx_page_context.getRequest();");
@@ -3450,10 +3512,10 @@
out.printil("ServletConfig config =
_jspx_page_context.getServletConfig();");
out.printil("JspWriter out = jspContext.getOut();");
out.printil("_jspInit(config);");
-
+
// set current JspContext on ELContext
out.printil("jspContext.getELContext().putContext(JspContext.class,jspContext);");
-
+
generatePageScopedVariables(tagInfo);
declareTemporaryScriptingVars(tag);
@@ -3482,7 +3544,7 @@
out.popIndent();
out.printil("} finally {");
out.pushIndent();
-
+
// handle restoring VariableMapper
TagAttributeInfo[] attrInfos = tagInfo.getAttributes();
for (int i = 0; i < attrInfos.length; i++) {
@@ -3494,10 +3556,10 @@
out.println(");");
}
}
-
+
// restore nested JspContext on ELContext
out.printil("jspContext.getELContext().putContext(JspContext.class,super.getJspContext());");
-
+
out.printil("((org.apache.jasper.runtime.JspContextWrapper)
jspContext).syncEndTagFile();");
if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) {
out.printil("_jspDestroy();");
@@ -3712,17 +3774,17 @@
boolean variableMapperVar = false;
for (int i = 0; i < attrInfos.length; i++) {
String attrName = attrInfos[i].getName();
-
+
// handle assigning deferred vars to VariableMapper, storing
// previous values under '_el_ve[i]' for later re-assignment
if (attrInfos[i].isDeferredValue() || attrInfos[i].isDeferredMethod()) {
-
+
// we need to scope the modified VariableMapper for consistency and
performance
if (!variableMapperVar) {
out.printil("javax.el.VariableMapper _el_variablemapper =
jspContext.getELContext().getVariableMapper();");
variableMapperVar = true;
}
-
+
out.printin("javax.el.ValueExpression _el_ve");
out.print(i);
out.print(" = _el_variablemapper.setVariable(");
@@ -3788,7 +3850,7 @@
/**
* Constructor.
- *
+ *
* @param n
* The custom tag whose tag handler class is to be
* introspected
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/webapps/docs/changelog.xml 2008-10-20 10:42:51 UTC (rev 812)
@@ -55,6 +55,9 @@
<fix>
Better nested context handling. (markt)
</fix>
+ <fix>
+ The default annotation name should be based on the class in which the annotation
was found. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
Modified: trunk/webapps/docs/config/context.xml
===================================================================
--- trunk/webapps/docs/config/context.xml 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/webapps/docs/config/context.xml 2008-10-20 10:42:51 UTC (rev 812)
@@ -51,22 +51,30 @@
<p><strong>Context</strong> elements may be explicitly defined:
<ul>
- <li>in the <code>$CATALINA_HOME/conf/context.xml</code> file:
- the Context element information will be loaded by all webapps</li>
- <li>in the
-
<code>$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default</code>
+ <li>In the <code>$CATALINA_BASE/conf/context.xml</code> file:
+ the Context element information will be loaded by all webapps.</li>
+ <li>In the
+
<code>$CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default</code>
file: the Context element information will be loaded by all webapps of that
- host</li>
- <li>in individual files (with a ".xml" extension) in the
- <code>$CATALINA_HOME/conf/[enginename]/[hostname]/</code> directory.
- The name of the file (less the .xml) extension will be used as the
+ host.</li>
+ <li>In individual files (with a ".xml" extension) in the
+ <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> directory.
+ The name of the file (less the .xml extension) will be used as the
context path. Multi-level context paths may be defined using #, e.g.
- <code>context#path.xml</code>. The default web application may be defined
- by using a file called <code>ROOT.xml</code>.</li>
- <li>if the previous file was not found for this application, in an individual
- file at <code>/META-INF/context.xml</code> inside the application
files</li>
- <li>inside a <a href="host.html">Host</a> element in the
main
- <code>conf/server.xml</code></li>
+ <code>foo#bar.xml</code> for a context path of
<code>/foo/bar</code>. The
+ default web application may be defined by using a file called
+ <code>ROOT.xml</code>.</li>
+ <li>Only if a context file does not exist for the application in the
+ <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code>, in an
individual
+ file at <code>/META-INF/context.xml</code> inside the application files.
If
+ the web application is packaged as a WAR then
+ <code>/META-INF/context.xml</code> will be copied to
+ <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> and renamed to
+ match the application's context path. Once this file exists, it will not be
+ replaced if a new WAR with a newer <code>/META-INF/context.xml</code> is
+ placed in the host's appBase.</li>
+ <li>Inside a <a href="host.html">Host</a> element in the
main
+ <code>conf/server.xml</code>.</li>
</ul>
</p>
Modified: trunk/webapps/docs/config/host.xml
===================================================================
--- trunk/webapps/docs/config/host.xml 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/webapps/docs/config/host.xml 2008-10-20 10:42:51 UTC (rev 812)
@@ -265,7 +265,7 @@
<code>true</code> (which is the default value):</p>
<ul>
<li>Any XML file in the
- <code>$CATALINA_HOME/conf/[engine_name]/[host_name]</code> directory
is
+ <code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> directory
is
assumed to contain a
<a href="context.html">Context</a> element (and its
associated
subelements) for a single web application. The <code>docBase</code>
@@ -279,20 +279,21 @@
directory of the same name (without the ".war" extension) will be
automatically expanded, unless the <code>unpackWARs</code> property
is set to <code>false</code>. If you redeploy an updated WAR file,
- be sure to delete the expanded directory when restarting JBoss Web, so
+ be sure to delete the expanded directory when restarting Tomcat, so
that the updated WAR file will be re-expanded (note that the auto
deployer, if enabled, will automatically expand the updated WAR file
- once the previously expanded directory is removed).</li>
+ once the previously expanded directory is removed). Multi-level contexts
+ may be defined by using #, eg use a WAR named
<code>foo#bar.war</code>
+ for a context path of <code>/foo/bar</code>.</li>
<li>Any subdirectory within the <em>application base
directory</em>
will receive an automatically generated <a href="context.html">
Context</a> element, even if this directory is not mentioned in the
- <code>conf/server.xml</code> file.
- This generated Context entry will be configured according to the
- properties set in any <a
href="defaultcontext.html">DefaultContext</a>
- element nested in this Host element. The context path for this
+ <code>conf/server.xml</code> file. The context path for this
deployed Context will be a slash character ("/") followed by the
directory name, unless the directory name is ROOT, in which case
- the context path will be an empty string ("").</li>
+ the context path will be an empty string (""). Multi-level contexts
+ may be defined by using #, eg use a directory named
<code>foo#bar</code>
+ for a context path of <code>/foo/bar</code>.</li>
</ul>
<p>In addition to the automatic deployment that occurs at startup time,