标签:context edr als aop config read frame component org
完整开发步骤
web.xml
spring核心控制器
指定mvc配置文件的路径
指定编码的filter
`<servlet>
<servlet-name>mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 指定springMVC配置文件的路径 -->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:mvc.xml</param-value>
</init-param>
<!-- 设置tomcat启动前去创建servlet对象 -->
<load-on-startup>1</load-on-startup>
</servlet>
<!-- 指定springMVC的所有控制器的访问路径都以*.do结尾 -->
<servlet-mapping>
<servlet-name>mvc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>`
spring工厂初始化的监听器
spring配置文件初始化
`
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--3. 手动指定配置文件路径 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/applicationContext.xml</param-value>
</context-param>
`
mvc.xml
applicationContext.xml
标签:context edr als aop config read frame component org
原文地址:https://www.cnblogs.com/lingboweifu/p/11804381.html