【spring】 --- spring配置文件详解

(RegionProposal Network)RPN网络结构及详解 RPN(RegionProposal Network)区域生成网络 Faster-RCNN的核心。在这里整理。 1.anchors。 特征可以看做一个尺度51*39的256通道图像,对于该图像的每一个位置,考虑9个可能的候选窗口:三种面积{128,256,512}×{128,256,512}×三种比例{1:1,1:2,2:1}{1:1,1:2,2:1}。这些候选窗口称为anchors... 阅读详情

转载于

出处:http://www.cnblogs.com/wxisme/

Spring、Spring MVC、MyBatis整合文件配置详解

使用SSM框架做了几个小项目了,感觉还不错是时候总结一下了。先总结一下SSM整合的文件配置。其实具体的用法最好还是看官方文档。

Spring:http://spring.io/docs

MyBatis:http://mybatis.github.io/mybatis-3/

基本的组织结构和用法就不说了,前面的博客和官方文档上都非常的全面。jar包可以使用Maven来组织管理。来看配置文件。

 

web.xml的配置                                                                                                                                                                 

web.xml应该是整个项目最重要的配置文件了,不过servlet3.0中已经支持注解配置方式了。在servlet3.0以前每个servlet必须要在web.xml中配置servlet及其映射关系。但是在spring框架中就不用了,因为Spring中是依赖注入(Dependency Injection)的也叫控制反转(Inversion of Control)。但是也要配置一个重要的servlet,就是前端控制器(DispatcherServlet)。配置方式与普通的servlet基本相似。

配置内容如下:

 

<!-- 配置前端控制器 -->
  <servlet>
      <servlet-name>spring</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <init-param>
          <!-- ContextconfigLocation配置springmvc加载的配置文件
          适配器、处理映射器等
           -->
          <param-name>contextConfigLocation</param-name>
          <param-value>WEB-INF/classes/spring/springmvc.xml</param-value>
  </init-param>
  </servlet>
  <servlet-mapping>
      <servlet-name>spring</servlet-name>
      <!-- 1、.action访问以.action结尾的  由DispatcherServlet进行解析
           2、/,所有访问都由DispatcherServlet进行解析
       -->
      <url-pattern>/</url-pattern>
  </servlet-mapping>

 

 

这里需要注意,springmvc.xml是spring配置文件,将在后面讨论。在<servlet-mapping>中url如果是.action,前端控制器就只会拦截以.action结尾的请求,并不会理会静态的文件。对静态页面的控制就要通过其他的手段。以/作为url的话就会拦截所有的请求,包括静态页面的请求。这样的话就可以拦截任何想要处理的请求,但是有一个问题。如果拦截了所有的请求,如果不在拦截器中做出相应的处理那么所有静态的js、css以及页面中用到的图片就会访问不到造成页面无法正常显示。但这可以通过静态资源的配置来解决这个问题。后面会提到。

配置spring容器:

<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/classes/spring/applicationContext-*.xml</param-value>

</context-param>

其中applicationContext-*.xml包含3个配置文件,是springIoC容器的具体配置。后面会提到。

配置一个监听器:

<listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

web.xml的完整配置是这样的:

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  <display-name></display-name>    
  
  <!-- 404错误拦截 -->
  <error-page>
    <error-code>404</error-code>
    <location>/error404.jsp</location>
  </error-page>
  <!-- 500错误拦截 -->
  <error-page>
    <error-code>500</error-code>
    <location>/error500.jsp</location>
  </error-page>
  
  <!-- 加载spring容器 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/classes/spring/applicationContext-*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    
  <!-- 配置前端控制器 -->
  <servlet>
      <servlet-name>spring</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <init-param>
          <!-- ContextconfigLocation配置springmvc加载的配置文件
          适配器、处理映射器等
           -->
          <param-name>contextConfigLocation</param-name>
          <param-value>WEB-INF/classes/spring/springmvc.xml</param-value>
  </init-param>
  </servlet>
  <servlet-mapping>
      <servlet-name>spring</servlet-name>
      <!-- 1、.action访问以.action结尾的  由DispatcherServlet进行解析
           2、/,所有访问都由DispatcherServlet进行解析
       -->
      <url-pattern>/</url-pattern>
  </servlet-mapping>
    
  <!-- 解决post乱码问题的过滤器 -->
  <filter>
      <filter-name>CharacterEncodingFilter</filter-name>
      <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
      <init-param>
          <param-name>encoding</param-name>
          <param-value>utf-8</param-value>
      </init-param>
  </filter>
  <filter-mapping>
      <filter-name>CharacterEncodingFilter</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>
  <welcome-file-list>
    <welcome-file>welcome.jsp</welcome-file>
  </welcome-file-list>
  
  
    
</web-app>

 

 看到配置文件中多了两块内容,一个是error page是用来友好的处理错误的,可以使用错误代码来区别并跳转到相应的处理页面。这段配置代码最好放到最前面,在前端控制器拦截之前处理。

还有一块内容是一个解决post乱码问题的过滤器,拦截post请求并编码为utf8。

springmvc.xml的配置                                                                                                                                                

视图解析器的配置:

 

<!-- 配置视图解析器 -->
     <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
         <!-- 使用前缀和后缀 -->
         <property name="prefix" value="/"></property>
         <property name="suffix" value=".jsp"></property>
</bean>

 

在Controller中设置视图名的时候会自动加上前缀和后缀。

Controller的配置

自动扫描方式,扫描包下面所有的Controller,可以使用注解来指定访问路径。

<!-- 使用组件扫描的方式可以一次扫描多个Controller -->
<context:component-scan base-package="com.wxisme.ssm.controller">

也可以使用单个的配置方式,需要指定Controller的全限定名。

<bean name="/queryUser.action" class="com.wxisme.ssm.controller.Controller1"/>

配置注解的处理器适配器和处理器映射器:

<!-- 注解的处理器适配器 -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/>
<!-- 注解的处理器映射器 -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>

也可以使用下面的简化配置:

<!-- 配置注解的处理器映射器和处理器适配器 -->
<mvc:annotation-driven conversion-service="conversionService"></mvc:annotation-driven>

配置拦截器,可以直接定义拦截所有请求,也可以自定义拦截路径。

 

<mvc:interceptors>
    <!-- 直接定义拦截所有请求 -->
    <bean class="com.wxisme.ssm.interceptor.IdentityInterceptor"></bean>
        <!-- <mvc:interceptor>
            拦截所有路径的请求   包括子路径
            <mvc:mapping path="/**"/>
            <bean class="com.wxisme.ssm.interceptor.IdentityInterceptor"></bean>
        </mvc:interceptor> -->
    </mvc:interceptors>

 

 配置全局异常处理器

<!-- 定义全局异常处理器 -->
    <!-- 只有一个全局异常处理器起作用 -->
    <bean id="exceptionResolver" class="com.wxisme.ssm.exception.OverallExceptionResolver"></bean>

配置文件上传数据解析器,在上传文件时需要配置。

 

<!--配置上传文件数据解析器  -->
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize">
            <value>9242880</value>
        </property>
    </bean>

 

还可以配置一些自定义的参数类型,以日期类型绑定为例。

 

<!-- 自定义参数类型绑定 -->
    <bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
     <property name="converters">
         <list>
             <!-- 日期类型绑定 -->
             <bean class="com.wxisme.ssm.controller.converter.DateConverter"/>
         </list>
     </property>
    </bean>

 

上面提到过如果在配置前端控制器时拦截了所有的请求,不做特殊处理就会导致部分静态资源无法使用。如果是这种情况就可以使用下面的配置来访问静态资源文件。

<mvc:resources mapping="/images/**" location="/images/" />
<mvc:resources mapping="/css/**" location="/css/" />  
<mvc:resources mapping="/js/**" location="/js/" />
<mvc:resources mapping="/imgdata/**" location="/imgdata/" />

也可以使用默认,但是需要在web.xml中配置。

<!-- 访问静态资源文件 -->
    <!-- <mvc:default-servlet-handler/> 需要在web.xml中配置-->

完全可以不拦截所有路径,大可避免这个问题的发生。

完整的配置大概是这样的,需要注意xml文件的命名空间,有时候会有影响的。

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
    
    
     <!-- 配置视图解析器 -->
     <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
         <!-- 使用前缀和后缀 -->
         <property name="prefix" value="/"></property>
         <property name="suffix" value=".jsp"></property>
     </bean>
     
     <!-- 使用组件扫描的方式可以一次扫描多个Controller -->
     <context:component-scan base-package="com.wxisme.ssm.controller">
     </context:component-scan>
     <!-- 配置注解的处理器映射器和处理器适配器 -->
    <mvc:annotation-driven conversion-service="conversionService"></mvc:annotation-driven>
    
    <!-- 自定义参数类型绑定 -->
    <bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
     <property name="converters">
         <list>
             <!-- 日期类型绑定 -->
             <bean class="com.wxisme.ssm.controller.converter.DateConverter"/>
         </list>
     </property>
    </bean>
    
    
    <!-- 访问静态资源文件 -->
    <!-- <mvc:default-servlet-handler/> 需要在web.xml中配置-->
    
    <mvc:resources mapping="/images/**" location="/images/" />
    <mvc:resources mapping="/css/**" location="/css/" />  
    <mvc:resources mapping="/js/**" location="/js/" />
    <mvc:resources mapping="/imgdata/**" location="/imgdata/" />
    
    <!-- 定义拦截器 -->
    <mvc:interceptors>
    <!-- 直接定义拦截所有请求 -->
    <bean class="com.wxisme.ssm.interceptor.IdentityInterceptor"></bean>
        <!-- <mvc:interceptor>
            拦截所有路径的请求   包括子路径
            <mvc:mapping path="/**"/>
            <bean class="com.wxisme.ssm.interceptor.IdentityInterceptor"></bean>
        </mvc:interceptor> -->
    </mvc:interceptors>
    
    <!--配置上传文件数据解析器  -->
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize">
            <value>9242880</value>
        </property>
    </bean>
    
    <!-- 定义全局异常处理器 -->
    <!-- 只有一个全局异常处理器起作用 -->
    <bean id="exceptionResolver" class="com.wxisme.ssm.exception.OverallExceptionResolver"></bean>
    
 </beans>

 

 

applicationContext-*.xml的配置                                                                                                

applicationContext-*.xml包括三个配置文件,分别对应数据层控制、业务逻辑service控制和事务的控制。

数据访问层的控制,applicationContext-dao.xml的配置:

配置加载数据连接资源文件的配置,把数据库连接数据抽取到一个properties资源文件中方便管理。

配置为:

<!-- 加载数据库连接的资源文件 -->
<context:property-placeholder location="/WEB-INF/classes/jdbc.properties"/>

其中jdbc.properties文件的内容如下:

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/database
jdbc.username=root
jdbc.password=1234

 

 配置数据库连接池,这里使用的是dbcp,别忘了添加jar包!

 

<!-- 配置数据源   dbcp数据库连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${jdbc.driver}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
</bean>

 

 

 Spring和MyBatis整合配置,jar包由MyBatis提供。

配置sqlSessionFactory

 

<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <!-- 数据库连接池 -->
    <property name="dataSource" ref="dataSource"/>
    <!-- 加载Mybatis全局配置文件 -->
    <property name="configLocation" value="/WEB-INF/classes/mybatis/SqlMapConfig.xml"/>

</bean>

 

 

 SqlMapConfig.xml文件是MyBatis的配置文件,后面会提到。

配置Mapper扫描器,扫描mapper包下的所有mapper文件和类,要求mapper配置文件和类名需要一致。

 

<!-- 配置mapper扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <!-- 扫描包路径,如果需要扫描多个包中间用半角逗号隔开 -->
    <property name="basePackage" value="com.wxisme.ssm.mapper"></property>
    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>

 

 整个applicationContext-dao.xml配置文件应该是这样的:

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">

<!-- 加载数据库连接的资源文件 -->
<context:property-placeholder location="/WEB-INF/classes/jdbc.properties"/>

<!-- 配置数据源   dbcp数据库连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${jdbc.driver}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
</bean>

<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <!-- 数据库连接池 -->
    <property name="dataSource" ref="dataSource"/>
    <!-- 加载Mybatis全局配置文件 -->
    <property name="configLocation" value="/WEB-INF/classes/mybatis/SqlMapConfig.xml"/>
</bean>

<!-- 配置mapper扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <!-- 扫描包路径,如果需要扫描多个包中间用半角逗号隔开 -->
    <property name="basePackage" value="com.wxisme.ssm.mapper"></property>
    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>


</beans>

 

 业务逻辑控制,applicationContext-service.xml的配置:

这个文件里暂时只需要定义service的实现类即可。

<!-- 定义service -->
<bean id="userService" class="com.wxisme.ssm.service.impl.UserServiceImpl"/>

 事务控制,applicationContext-transaction.xml的配置

配置数据源,使用JDBC控制类。

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <!-- 配置数据源 -->
    <property name="dataSource" ref="dataSource"/>
</bean>

 配置通知,事务控制。

 

<!-- 通知 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <!-- 传播行为 -->
            <tx:method name="save*" propagation="REQUIRED"/>
            <tx:method name="insert*" propagation="REQUIRED"/>
            <tx:method name="update*" propagation="REQUIRED"/>
            <tx:method name="delete*" propagation="REQUIRED"/>
            <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
            
        </tx:attributes>
    </tx:advice>

 

 配置AOP切面

<!-- 配置aop  -->
    <aop:config>
        <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.wxisme.ssm.service.impl.*.*(..))"/>
    </aop:config>

 整个事务控制的配置是这样的:

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
    
<!-- 事务控制  对MyBatis操作数据库  spring使用JDBC事务控制类 -->

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <!-- 配置数据源 -->
    <property name="dataSource" ref="dataSource"/>
</bean>
    
    <!-- 通知 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <!-- 传播行为 -->
            <tx:method name="save*" propagation="REQUIRED"/>
            <tx:method name="insert*" propagation="REQUIRED"/>
            <tx:method name="update*" propagation="REQUIRED"/>
            <tx:method name="delete*" propagation="REQUIRED"/>
            <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
            
            
        </tx:attributes>
    </tx:advice>
    
    <!-- 配置aop  -->
    <aop:config>
        <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.wxisme.ssm.service.impl.*.*(..))"/>
    </aop:config>
    
    
</beans>

 

 

 MyBatis的配置                                                                                                                                             

SqlMapConfig.xml的配置   全局setting配置这里省略,数据库连接池在spring整合文件中已经配置,具体setting配置参考官方文档。

别名的定义:

<typeAliases>
    <!-- 批量定义别名 ,指定包名,自动扫描包中的类,别名即为类名,首字母大小写无所谓-->
    <package name="com.wxisme.ssm.po"/>
</typeAliases>

mapper映射文件的配置:

 

<mappers>
    <!-- 加载映射文件 -->
    <!-- 这里也可以使用class来加载映射文件,前提是:使用mapper代理的方法,遵循规范,
    并且两个文件必须同名且在同一目录
    <mapper class="com.wxisme.mybatis0100.mapper.UserMapper"/>
    基于class加载,可以进行批量加载
    -->
    <!-- 通过扫描包的方式来进行批量加载映射文件 -->
    <package name="com.wxisme.ssm.mapper"/>
     
     
</mappers>

 

 整个文件的配置应该是这样的:

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

<!-- 将数据库连接数据抽取到属性文件中方便测试 -->
<!-- <properties resource="/WEB-INF/classes/jdbc.properties"></properties> -->
<!-- 别名的定义 -->
<typeAliases>
    <!-- 批量定义别名 ,指定包名,自动扫描包中的类,别名即为类名,首字母大小写无所谓-->
    <package name="com.wxisme.ssm.po"/>
</typeAliases>

<!-- 数据库连接用数据库连接池 -->

<mappers>
    <!-- 通过扫描包的方式来进行批量加载映射文件 -->
    <package name="com.wxisme.ssm.mapper"/>
</mappers>
</configuration>

 

 具体mapper文件的配置,在使用mapper代理的方法时,命名空间需要是对应的Mapper类。

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wxisme.ssm.mapper.AlbumMapper" >
  
</mapper>

 

Unity内存优化:从崩溃到流畅的终极指南 Emscripten 为 WebAssembly 设定的内存布局(Static、Stack 和 Heap)为开发者提供了一个清晰的内存管理框架。理解这些内存区域的特性和用途,有助于开发者在 WebGL 项目中更有效地管理内存,优化性能,减少内存使用峰值。在 Unity WebGL 中,Dynamic Memory 是 UnityHeap 的主要组成部分,负责存储游戏运行时所需的各种数据。Dynamic Memory 主要分为两类:Managed Memory 和 Native Memory。 阅读详情

相关推荐

整合Springboot+MybatisPlus+达梦数据库

整合Springboot+MybatisPlus+达梦数据库,以及一些坑

波波的博客 6678

Spring、Spring MVC、MyBatis整合文件配置详解

使用SSM框架做了几个小项目了,感觉还不错是时候总结一下了。先总结一下SSM整合的文件配置。其实具体的用法最好还是看官方文档。 Spring:http://spring.io/docs MyBatis:http://mybatis.github.io/mybatis-3/ 基本的组织结构和用法就不说了,前面的博客和官方文档上都非常的全面。jar包可以使用Maven来组织管理。来看配置文件。 ...

weixin_34072159的博客 409

【记录】游戏体验报告怎么写(自我成长篇)

2019年3月更新: 这个倒是不用推翻,我个人虽然写的东西还是有一些偏差的,但是“表哥”说的倒是没毛病的,这篇主要是为了记录用,具体的干货也有,都在图片里,请自行提取 =====18年初原答案 作为一个游戏策划新人,游戏分析可能抓不到点子上,试着总结记录一下游戏体验报告分析的成长(因为水平不同,视野可能也不一样,也许之后几年回头看这些东西都是小儿科或者是错误的,所以只写出当下的想...

eat_human的博客 6万+

Spring.xml和SringMVC.xml和Mybatis.xml的基本配置

Spring.xml和SringMVC.xml和Mybatis.xml的基本配置

ouo1231的博客 616

kaggle项目:纽约出租车行程时间NYC Taxi Trip Duration

纽约出租车形成时间预测(NYC Taxi Trip Duration)是Kaggle中的一个Playground竞赛。比赛数据集基于2016年纽约市黄色出租车行程记录数据,需要建立一个模型,根据单个行程属性,预测测试集中每次行程的持续时间。Kaggle项目模型XGBoost,评价指标RMSLE。

weixin_42113929的博客 2790

基于双目视觉的行车中障碍距离检测方法研究与目标跟踪

本文将介绍基于Python语言的双目视觉技术,以及如何使用该技术检测行车中的障碍物并跟踪目标。双目视觉利用两个摄像头模拟人眼的立体视觉,通过对两个摄像头所捕捉的图像进行比较和分析,可以得到物体的深度信息。首先,我们需要安装Python的OpenCV库,该库提供了丰富的图像处理和计算机视觉功能。接下来,我们进入一个循环中,不断读取左右图像,并将其转换为灰度图像。在视差图上,您可以实现目标检测和跟踪算法来识别和跟踪行车中的障碍物。请注意,上述代码只是一个简单示例,您可以根据具体需求和算法进行修改和扩展。

ZgnObjectivec的博客 277

后缀.do和.action

页面中.do和.action的后缀看到网页里面有.do和.action的后缀。就想这是什么工具要求的呢? 网上查询了一下,基本得到的答案是: .do是struts 1默认的后缀 .action是struts 2默认的后缀.action我是知道的。.do还没有来的及查证,不过应该没有错。

zhangyiant的专栏 5056

假新闻检测论文分享(30)MMDFND: Multi-modal Multi-Domain Fake News Detection

现有的假新闻检测方法通常集中在单一领域的新闻上,如健康或政治。然而,社交媒体上的新闻往往来自多个领域,这给单一领域的假新闻检测方法带来了两个主要挑战:数据稀缺性:处理较小、单一领域的新闻数据集时,由于训练数据的稀缺,模型的有效性显著下降。跨领域检测的准确性下降:单一领域的假新闻检测方法在跨领域新闻数据集上的准确性大幅降低。缓解领域间模态语义偏差:通过DPLE网络提取跨领域和领域特定的知识,缓解了不同领域间文本和图像的语义差异。

weixin_41964296的博客 671

SpringMvc(三)配置Mybatis

之前做好了SpringMvc的框架,直接用的jdbc连接数据库不是很方便,这里搭建下Mybatis,hibernate我没用过,Mybatis也不用自己写sql.xml,可以用插件自动生成,方法如下: 首先要在Eclipse安装Mybatis Generator 点击help--install new software 输入地址如下 http://mybatis.googlecode.com...

216

2026.2.3:OpenClaw国内安装教程,国内网络使用,服务器部署,对接飞书

本文介绍了如何创建飞书应用并接入OpenClaw机器人的完整流程。主要内容包括:1)在飞书开放平台创建企业自建应用,添加机器人能力并开通相关权限;2)在Windows11系统上安装OpenClaw,完成配置文件的修改(需将bind改为"lan");3)配置MiniMax国内接口地址,重启gateway服务。整个过程涵盖了应用创建、权限设置、软件安装、服务配置等关键步骤,为开发者提供了详细的飞书机器人接入指南。

拥抱具身智能,昇腾Ascend C 3997

AI自瞄原理剖析(四)从Yolo推理坐标到屏幕坐标:基于FOV视角与焦距的坐标变换与精准瞄准

从Yolo推理框架得到的坐标到屏幕坐标的转换是一个涉及到FOV视角、焦距以及分辨率的复杂过程。通过数学公式,我们可以将推理框坐标反推为游戏内的实际坐标,并最终映射到屏幕坐标系中。利用这些信息,AI自瞄系统能够精确计算出准星从当前位置移动到敌人位置的距离,实现精准的自动瞄准。通过这种方法,AI自瞄系统能够在不同的游戏环境下灵活应对,提供高度精确的操作体验。在AI自瞄系统中,目标检测仅仅是第一步,获取到预测框的坐标后,我们还需要将这些坐标转换为实际屏幕上的精确位置。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1334

java框架action_struts2框架-----Action

控制器ActionAction对象是struts2框架的核心,每个URL映射到特定的Action,其提供处理来自用户的请求所需要的处理逻辑。Action有两个重要的功能,即将数据从请求传递到视图和协助框架确定哪个结果应该是呈现在响应请求中的视图中。一、Action接口Action是com.opensymphony.xwork2包中的一个接口,提供了5个静态的成员变量,是struts2框架中为处理结...

weixin_39987120的博客 560

Vulkan入门系列3 - 绘制三角形代码解析(全)

【代码】Vulkan入门系列3 - 绘制三角形完整代码(带详细注释)

GPU全栈博主 1034

详解Spring配置文件

详解Spring配置文件

逐梦苍穹的博客 5911

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

spring配置文件详解_Spring配置文件简介

spring配置文件详解 这么多的人,那么多的思想。 当我们为不同的客户实施软件时,有时我们需要处理同一项目的各种需求。 例如,客户A需要SAML身份验证,客户B需要LDAP身份验证。 使用Spring Profiles(可从Spring 3.1获得),我们能够提供一种方法来隔离我们已实现的应用程序配置的各个部分。 该博客将帮助我们提供某些代码或仅适用于特定要求的某些Spring bean。 ...

cunhui1209的博客 294

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

spring配置文件详解

转自:http://book.51cto.com/art/201004/193743.htm Spring配置文件是用于指导Spring工厂进行Bean生产、依赖关系注入(装配)及Bean实例分发的"图纸"。Java EE程序员必须学会并灵活应用这份"图纸"准确地表达自己的"生产意图"。Spring配置文件是一个或多个标准的XML文档,applicationContext.xml是Spring的...

菜鸟程序员成长路 5万+

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Spring 配置文件详解

spring配置文件详解

sinat_26553595的博客 8019

logback-spring.xml配置文件详解(备份)

logback-spring配置文件

Gorden的博客 5607

详解Spring的配置文件

想必用过Spring的程序员们都有这样的感觉,Spring把逻辑层封装的太完美了(个人感觉View层封装的不是很好)。以至于有的初学者都不知道Spring配置文件的意思,就拿来用了。所以今天我给大家详细解释一下Spring的applicationContext.xml文件。Ok,还是通过代码加注释的方式为大家演示:以下是详解Spring的applicationContext.xml文件代码:

eclipse 535

Spring配置文件详解

Spring配置文件详解 1、spring的配置文件详解 Bean标签基本配置 用于配置对象让 spring 来创建的。 默认情况下它调用的是类中的无参构造函数。如果没有无参构造函数则不能创建成功。 属性: id:给对象在容器之中提供一个唯一标识类 class:指定类的权限定名称。用于反射创建对象 bean标签范围配置 scope: 指定对象的作用范围 singleton:单例 prototype:多例 requst:WEB 项目中,Spring 创建一个 Bean 的对象,将对象存入到 re

m0_64785784的博客 1761

spring学习(spring 配置文件详解)

步骤常见的标签:bean1 当你没有设置 id时,可以使用name表示 2 name 甚至是可以表示别名3 如果只有class 也可以获得目标对象,取代 name甚至 id 的地位4 如果存在 id ,或name 任意一个,使用class会报错1 验证 singleton:默认值,每次通过getBean方法获得是同一个对象2 验证 prototype ,每次通过getBean方法获得是新的对象3 singleton 参与bean 完整的生命周期,而prototype不是,没有最后的销毁 4 init-met

等什么君!的博客 765

Spring Boot之配置文件详解

Spring Boot之配置文件详解 Spring Boot 提供了大量的自动配置,极大地简化了spring 应用的开发过程,当用户创建了一个 Spring Boot 项目后,即使不进行任何配置,该项目也能顺利的运行起来。当然,用户也可以根据自身的需要使用配置文件修改 Spring Boot 的默认设置。 SpringBoot 默认使用以下 2 种全局的配置文件,其文件名是固定的。 application.properties application.yml 其中,application.yml 是一种

yinyin_xiao的博客 2222

Spring XML配置文件详解

​ spring配置文件是用于指导Spring工厂进行Bean生产、依赖关系注入(装配)及Bean实例分发的"图纸"。Spring框架的配置文件是基于xml的,Spring强大的功能依赖于类型繁多的配置项,这些配置项纷繁复杂难以记忆,下面将常用的配置项示例记录下来,以备后续查看使用。 一、Spring配置文件示例 <?xml version="1.0" encoding="UTF-8"?&...

算云烟 3万+

Spring配置文件中关于约束配置详解

一、Spring配置文件常见的配置头 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:con...

六年鹿苑的博客 6408
上一篇: 【spring】--- springMVC详解及简单实现
下一篇: 【linux】--- 恢复删除的文件
Beat_Boxer
博客等级 码龄9年 18粉丝 88原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值