`
jackleechina
  • 浏览: 584632 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类

spring 的api配置 备注

 
阅读更多
1)controller
<!-- basedata start -->
	<servlet>
		<servlet-name>basedata</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
	    <servlet-name>basedata</servlet-name>
	    <url-pattern>/application/basedata/*</url-pattern> //这里是url路径
	</servlet-mapping>
	<!-- basedata end -->

然后在basedata-servlet.xml里面配置
<context:component-scan base-package="com.cvt.smarthome" use-default-filters="false">
		<context:include-filter type="regex" expression="com.cvt.smarthome.application.basedata.controller.*"/>
	</context:component-scan>




2)api
<servlet>
		<servlet-name>api</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
	    <servlet-name>api</servlet-name>
	    <url-pattern>/api/*</url-pattern>
	</servlet-mapping>

然后在api-servlet.xml里面配置
<context:component-scan>
<context:include-filter type="regex" expression="com.cvt.smarthome.application.basedata.api.*"/>
	</context:component-scan>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics