zoukankan      html  css  js  c++  java
  • spring的扫描配置

    <!-- 自动注册并检查@Required,@Autowired的属性注入 -->
        <context:component-scan base-package="com.xzm"></context:component-scan>
        <!-- 配置C3P0数据源 -->
        <context:property-placeholder ignore-resource-not-found="true" location="classpath*:com/xzm/config/spring/db.properties" />
        <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
        <property name="driverClass" value="${c3p0.mysql.driverClass}" />
        <property name="jdbcUrl" value="${c3p0.jdbcUrl}" />
        <property name="user" value="${c3p0.user}" />
        <property name="password" value="${c3p0.password}" />
        <property name="minPoolSize" value="${c3p0.minPoolSize}" />
        <property name="maxPoolSize" value="${c3p0.maxPoolSize}" />
        <property name="initialPoolSize" value="${c3p0.initialPoolSize}" />
        <property name="acquireIncrement" value="${c3p0.acquireIncrement}" />
        <property name="acquireRetryAttempts" value="${c3p0.acquireRetryAttempts}" />
        <property name="maxIdleTime" value="${c3p0.maxIdleTime}" />
        </bean>


    SpringMVC

    <!-- 自动扫描包下@Controller -->
        <context:component-scan base-package="com.xzm"></context:component-scan>
        <!-- 添加注解支持 -->
        <mvc:annotation-driven />
        
        <context:annotation-config />  
        
        <!-- 定义JSP文件的位置 -->  
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/views/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
  • 相关阅读:
    HTML+CSS面试题汇总(持续更新)
    vue-router
    MongoDB
    闭包
    JavaScript的严格模式
    IO题目
    Java 题目集 编程
    Java题目集 函数
    2.面向对象基础-04继承
    2.面向对象基础-03Java数组
  • 原文地址:https://www.cnblogs.com/xuzhenmin/p/3480033.html
Copyright © 2011-2022 走看看