简体   繁体   English

XML中的列表标记。 我不明白它的作用

[英]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的拦截器列表中。

4.4.2.4 Collections 4.4.2.4集合

In the <list/> , <set/> , <map/> , and <props/> elements, you set the properties and arguments of the Java Collection types List , Set , Map , and Properties , respectively. <list/><set/><map/><props/>元素中,分别设置Java集合类型ListSetMapProperties的属性和参数。

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.

相关问题 我必须用另一个xml制作一个新的xml。 我还是不知道该怎么办 - I have to make a new xml out of another xml. I still don't know how can I do it Windows Installer xml WIX,在控件中,文本元素可以是什么? 有些语法我不明白 - windows installer xml WIX, in a control, what can the text element be? there are some syntax that I don't understand XML内的HTML。 我应该使用CDATA还是对HTML进行编码 - Html inside XML. Should I use CDATA or encode the HTML LINQ 到 XML。 如何查询列表<t>与 Linq 递归</t> - LINQ to XML. How to query List<T> with Linq recursively “center_horizo​​ntal 与属性重力不兼容....” xml 新手,我不明白我的问题是什么 - "center_horizontal is incompatible with attribute gravity...." New to xml and I don't understand what my issue is here PHP XML。 如何检查标签的值是否为0 - PHP XML. How to check if value of a tag is 0 jQuery和XML。 将节点作为列表项 - jquery and xml. Getting nodes as list items 不明白 XML 加载到 SQL 数据库 - Don't understand XML load into SQL database 在python中解析xml - 不了解DOM - Parsing xml in python - don't understand the DOM 我有一个包含数据的字符串,我想将此字符串文件存储到 xml 中。 我应该怎么办? - I have a string with data i want to store this string file into xml. what should i do?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM