如何在spring-servlet.xml 中引入别的springmvc配置文件
1个回答
展开全部
你就直接创建多个这样的XXX-servlet.xml
web.xml中这样配置
Java code?
<servlet>
<servlet-name>dmt</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springweb/*-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dmt</servlet-name>
<url-pattern>*.do</url-pattern> <!--匹配跳转的后缀名-->
</servlet-mapping>
web.xml中这样配置
Java code?
<servlet>
<servlet-name>dmt</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springweb/*-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dmt</servlet-name>
<url-pattern>*.do</url-pattern> <!--匹配跳转的后缀名-->
</servlet-mapping>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询