Where to look for the exact configuration effects of the <namespace of Spring spaces?

As you know, the Spring Framework has many configuration elements in the XML namespaces, such as:

  • <mvc:annotation-config/>
  • <tx:annotation-driven/>

Some of them do really huge work, for example: <http>an element in the Spring security space security.

Where can I find the exact code (more than the documentation says) for all the effects of introducing a particular XML element?

For example - where should I see if I want to see the exact Spring actions caused by using an element <security:csrf>in an element <security:http>? (which filters / interceptors / converters are added, which area attributes become available, etc.)

+4
source share
2 answers

Almost every namespace (xsd) has a corresponding class NamespaceHandlersomewhere in Spring. The same goes for elements, each element has a corresponding one BeanDefinitionParser.

See javadoc for an affordable implementation in Spring. Spring Security can be found here .

Most Spring projects now use the namespace generally somewhere in the package org.springframework.[project].config.

+1
source

In short, you should:

  • The author of the XML Schema file .
  • Use NameSpaceHandler
  • Use BeanDefinitionParser
  • Register handler and schema in META-INF

Refer to this document for details.

Spring -security namespace details spring -Security--x.x.X.RELEASE-sources.jar

+1

Source: https://habr.com/ru/post/1544320/


All Articles