[英]List tag inside XML. I don't understand what it does
This is a question related to Spring MVC. 这是与Spring MVC有关的问题。 I have entries in an XML file like this. 我在这样的XML文件中有条目。
<bean class="org.springframework.web...DefaultAnotationHandlerMapping">
<property name="interceptors">
<list>
<bean class="rewardsonline.AuditInterceptor"/>
<bean class="rewardsonline.PerformanceInterceptor"/>
</list>
</property>
</bean>
Now, I understand that the property called interceptors is an instance variable of the class DefaultAnnotationHandlerMapping. 现在,我知道称为拦截器的属性是DefaultAnnotationHandlerMapping类的实例变量。 But, I cannot make sense of the list tag. 但是,我无法理解list标签。 What does that indicate? 这说明什么?
The AbstractHandlerMapping class has a property called interceptors which is a List. AbstractHandlerMapping类具有称为拦截器的属性,该属性是一个List。 The List element in the XML lists the interceptors which should be added to the interceptor list on AbstractHandlerMapping when it's initialized. XML中的List元素列出了拦截器,初始化后应将其添加到AbstractHandlerMapping的拦截器列表中。
In the
<list/>
,<set/>
,<map/>
, and<props/>
elements, you set the properties and arguments of the Java Collection typesList
,Set
,Map
, andProperties
, respectively. 在<list/>
,<set/>
,<map/>
和<props/>
元素中,分别设置Java集合类型List
,Set
,Map
和Properties
的属性和参数。
Your XML fragment is constructing a java.util.List
and injecting it ino the interceptors
property of the DefaultAnotationHandlerMapping
object. 您的XML片段正在构造一个java.util.List
并将其注入DefaultAnotationHandlerMapping
对象的interceptors
属性中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.