AOS 增加自己开发包配置

来源:互联网 发布:restful android php 编辑:程序博客网 时间:2024/05/16 09:24
aos.web.xml    -- 配置web  
<!-- 扫描@Controller组件 -->
<!-- 提示:将com.mycorp.mysystem该为您的业务系统的包路径 -->
<context:component-scan base-package="cn.osworks.aos;cn.autobuilder"
  use-default-filters="false">
  <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  <context:include-filter type="annotation"
   expression="org.springframework.web.bind.annotation.ControllerAdvice" />
 </context:component-scan>
aos.dao.xml
<!-- 平台缺省数据源 SqlSessionFactory配置 -->
 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <!-- 请将com.mycorp.mysystem.**改为你的项目扫描路径 -->
  <property name="typeAliasesPackage" value="cn.osworks.aos;cn.autobuilder" />
  <property name="mapperLocations" value="classpath*:**/*Mapper.xml" />
  <property name="configLocation" value="classpath:core/aos.dao.cfg.xml" />
 </bean>
 <!-- 扫描实体数据访问对象Mapper -->
 <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  <!--项目扫描路径 -->
  <property name="basePackage" value="cn.osworks.aos;cn.autobuilder" />
  <property name="annotationClass" value="cn.osworks.aos.core.annotation.Mapper" />
  <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
 </bean>
aos.service.xml
<!-- Spring服务组件扫描(排除@Controller相关组件) -->
 <!-- 请将你的项目扫描路径 -->
 <context:component-scan base-package="cn.osworks.aos;cn.autobuilder" use-default-filters="false">
  <context:include-filter type="annotation" expression="org.springframework.stereotype.Service" />
  <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  <context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice" />
 </context:component-scan>

1 0