<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:annotation-driven />
<mvc:view-controller path="/index.html" /> <bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"
p:definitions="/WEB-INF/tiles-defs/templates.xml" />
<bean id="tilesViewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver"
p:viewClass="org.springbyexample.web.servlet.view.tiles2.DynamicTilesView"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" /> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"
p:basenames="messages" />
<!-- Declare the Interceptor -->
<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"
p:paramName="locale" />
</mvc:interceptors>
<!-- Declare the Resolver -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" /></beans>
以上是spring mvc 注解的webmvc-context.xml配置文件,请帮忙对每一个标签进行解释,谢谢
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:annotation-driven />
<mvc:view-controller path="/index.html" /> <bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"
p:definitions="/WEB-INF/tiles-defs/templates.xml" />
<bean id="tilesViewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver"
p:viewClass="org.springbyexample.web.servlet.view.tiles2.DynamicTilesView"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" /> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"
p:basenames="messages" />
<!-- Declare the Interceptor -->
<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"
p:paramName="locale" />
</mvc:interceptors>
<!-- Declare the Resolver -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" /></beans>
以上是spring mvc 注解的webmvc-context.xml配置文件,请帮忙对每一个标签进行解释,谢谢
2. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
3. xmlns:context="http://www.springframework.org/schema/context"
4. xsi:schemaLocation="http://www.springframework.org/schema/beans
5. http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
6. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
7.
8. <!-- Initializing Spring FrameworkServlet 'annomvc' 时实例化bean,并自动依赖注入 -->
9.
10. <!--①:规约所有进行扫描的类,以完成Bean创建和自动依赖注入的功能-->
11. <context:component-scan base-package=" xxx.user.web" />
12.
13. <!-- ②:启动Spring MVC的注解功能,完成请求和注解POJO的映射 -->
14. <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
15.
16. <!-- ③:对模型视图名称的解析,即在模型视图名称添加前后缀 -->
17. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsps/" p:suffix=".jsp" />
18.
19. </beans>