Minor BD parser tidying.

This commit is contained in:
Luke Taylor 2010-08-20 21:12:46 +01:00
parent d04e37c0c4
commit 1db83fc81e
2 changed files with 5 additions and 14 deletions

View File

@ -75,11 +75,6 @@ class HttpConfigurationBuilder {
private static final String ATT_REF = "ref";
private static final String ATT_SECURED = "security";
private static final String OPT_SECURITY_NONE = "none";
private static final String OPT_SECURITY_CONTEXT_ONLY = "contextOnly";
private final Element httpElt;
private final ParserContext pc;
private final SessionCreationPolicy sessionPolicy;
@ -112,7 +107,7 @@ class HttpConfigurationBuilder {
if (StringUtils.hasText(urlElt.getAttribute(ATT_FILTERS))) {
pc.getReaderContext().error("The use of \"filters='none'\" is no longer supported. Please define a" +
" separate <http> element for the pattern you want to exclude and use the attribute" +
" \"secured='false'\".", pc.extractSource(urlElt));
" \"security='none'\".", pc.extractSource(urlElt));
}
}

View File

@ -93,9 +93,9 @@ public class HttpSecurityBeanDefinitionParser implements BeanDefinitionParser {
}
List<BeanMetadataElement> createFilterChain(Element element, ParserContext pc, MatcherType matcherType) {
String security = element.getAttribute(ATT_SECURED);
boolean secured = !OPT_SECURITY_NONE.equals(element.getAttribute(ATT_SECURED));
if (StringUtils.hasText(security)) {
if (!secured) {
if (!StringUtils.hasText(element.getAttribute(ATT_PATH_PATTERN))) {
pc.getReaderContext().error("The '" + ATT_SECURED + "' attribute must be used in combination with" +
" the '" + ATT_PATH_PATTERN +"' attribute.", pc.extractSource(element));
@ -103,16 +103,12 @@ public class HttpSecurityBeanDefinitionParser implements BeanDefinitionParser {
for (int n=0; n < element.getChildNodes().getLength(); n ++) {
if (element.getChildNodes().item(n) instanceof Element) {
pc.getReaderContext().error("If you are using <htt> to define an unsecured pattern, " +
pc.getReaderContext().error("If you are using <http> to define an unsecured pattern, " +
"it cannot contain child elements.", pc.extractSource(element));
}
}
if (security.equals(OPT_SECURITY_NONE)) {
return Collections.emptyList();
}
return Collections.emptyList();
}
final String portMapperName = createPortMapper(element, pc);