View | Details | Raw Unified | Return to bug 53465
Collapse All | Expand All

(-)java/org/apache/catalina/startup/WebRuleSet.java (-1 / +30 lines)
Lines 24-29 Link Here
24
24
25
import org.apache.catalina.deploy.ContextHandler;
25
import org.apache.catalina.deploy.ContextHandler;
26
import org.apache.catalina.deploy.ContextService;
26
import org.apache.catalina.deploy.ContextService;
27
import org.apache.catalina.deploy.ResourceBase;
27
import org.apache.catalina.deploy.SecurityConstraint;
28
import org.apache.catalina.deploy.SecurityConstraint;
28
import org.apache.catalina.deploy.ServletDef;
29
import org.apache.catalina.deploy.ServletDef;
29
import org.apache.catalina.deploy.WebXml;
30
import org.apache.catalina.deploy.WebXml;
Lines 541-546 Link Here
541
                "setName", 0);
542
                "setName", 0);
542
        digester.addCallMethod(fullPrefix + "/resource-env-ref/resource-env-ref-type",
543
        digester.addCallMethod(fullPrefix + "/resource-env-ref/resource-env-ref-type",
543
                "setType", 0);
544
                "setType", 0);
545
        digester.addRule(fullPrefix + "/resource-env-ref/mapped-name", new MappedNameRule());
544
        configureInjectionRules(digester, "web-app/resource-env-ref/");
546
        configureInjectionRules(digester, "web-app/resource-env-ref/");
545
547
546
        //message-destination
548
        //message-destination
Lines 595-600 Link Here
595
                               "setScope", 0);
597
                               "setScope", 0);
596
        digester.addCallMethod(fullPrefix + "/resource-ref/res-type",
598
        digester.addCallMethod(fullPrefix + "/resource-ref/res-type",
597
                               "setType", 0);
599
                               "setType", 0);
600
        digester.addRule(fullPrefix + "/resource-ref/mapped-name", new MappedNameRule());
598
        configureInjectionRules(digester, "web-app/resource-ref/");
601
        configureInjectionRules(digester, "web-app/resource-ref/");
599
602
600
        //service-ref
603
        //service-ref
Lines 1247-1251 Link Here
1247
        }
1250
        }
1248
    }
1251
    }
1249
1252
1250
    
1253
}
1254
1255
/**
1256
 * A Rule that sets mapped name on the ResourceBase.
1257
 */
1258
final class MappedNameRule extends Rule {
1259
1260
    public MappedNameRule() {
1261
        //no-op
1262
    }
1263
1264
    /**
1265
     * Process the body text of this element.
1266
     *
1267
     * @param namespace the namespace URI of the matching element, or an 
1268
     *   empty string if the parser is not namespace aware or the element has
1269
     *   no namespace
1270
     * @param name the local name if the parser is namespace aware, or just 
1271
     *   the element name otherwise
1272
     * @param text The body text of this element
1273
     */
1274
    @Override
1275
    public void body(String namespace, String name, String text)
1276
            throws Exception {
1277
        ResourceBase resourceBase = (ResourceBase) digester.peek();
1278
        resourceBase.setProperty("mappedName", text.trim());
1279
    }
1251
}
1280
}

Return to bug 53465