1.项目结构

2.配置文件

对配置文件进行总结:

 pom.xml
web.xml
-> 配置web相关
-> 读取application*.xml
5 -> 读取logback.xml
applicationContext.xml
->配置spring的主要信息
->读取sqlMapConfig.xml
->读取mapper.xml
->读取ehcache.xml
sqlMapConfig.xml
->配置mybatis相关
mapper.xml
->mybatis的映射文件
ehcache.xml
->配置ehcache相关
applicationContext-rms.xml
->配置项目相关
applicationContext-shiro.xml
->配置shiro相关

(1)pom.xml

 <!--1 单元测试-->
junit
<!--2 spring相关依赖 为什么没有spring-beans?-->
<!--核心依赖-->
spring-core
spring-context
spring-context-support
<!--web相关-->
spring-web
spring-webmvc
<!--数据库相关-->
spring-jdbc
spring-tx
<!--redis相关-->
spring-data-redis
jedis
<!--3 mybatis-->
mybatis
mybatis-spring
<!--4 日志-->
slf4j-api
logback-classic
<!--5 JSON-->
fastjson
<!--6 数据库-->
<!--连接池-->
druid
<!--驱动-->
mysql-connector-java
postgresql
<!--7 apache工具-->
commons-beanutils
commons-lang
<!--8 shiro相关依赖-->
shiro-core
shiro-web
shiro-aspectj
shiro-spring
shiro-ehcache
shiro-quartz
<!--9 ehcache相关依赖-->
ehcache
<!--10 servlet-->
javax.servlet-api
<!--11 标签库-->
jstl
<!--12 jersey相关依赖-->
jersey-bundle
jersey-spring
<!-- 这里<exclusions>了spring的几个包,为什么?-->
spring-beans,spring-context,spring-core,spring-web,spring-aop
<!--13 不太明白作用的-->
aspectjweaver
javaee-api

(2)web.xml

 <!--配置文件读取-->
contextConfigLocation:classpath*:/spring/**/applicationContext*.xml
logbackConfigLocation:file:/usr/local/***/***/conf/logback.xml
<!--监听器-->
LogbackConfigListener
ContextLoaderListener
<!--Servlet-->
RESTServlet
DruidStatView
<!--过滤器-->
CharacterEncodingFilter
<!--shiroFilter-->
DelegatingFilterProxy

(3)applicationContext.xml

 <!--配置文件读取-->
<context:property-placeholder location=**/> <!--支持注解-->
<context:annotation-config/> <!--自动扫描的包,过滤被扫描的类-->
<context:component-scan base-package="******">
<context:exclude-filter> ***
<context:include-filter> *** <!--dataSource;sqlSeesionFactory;sqlSessionTemplate-->
<bean id="dataSource">
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
dataSource
typeAliasesPackage
configLocation:classpath:resources/mybatis/sqlMapConfig.xml
mapperLocation: classpath:sql/*.xml
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
sqlSessionFactory <!--通过自动扫描方式创建mapper bean-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <!--事务管理-->
<tx:annotation-driven transaction-manager="transactionManager">
<bean id="transactionManager>
dataSource <!--cache-->
<cache:annotation-driven cache-manager="cacheManager" proxy-target-class="false"/>
<bean id="ehcacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
configLocation:classpath:ehcache/ehcache.xml
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
cacheManager:ehcacheManager

(4)application-rms.xml

 <!--国际化资源-->
<bean id="messageSource" class="com.baosight.common.message.XinsightResourceBundleMessageSource">

(5)application-shiro.xml

//todo

(6)ehcache.xml

 <defaultCache>
<cache name="authorizationCache">
<cache name="authenticationCache">

(7)sqlMapConfig.xml

 <configuration>
<!--除去environments节点(datasource和txmanager本来的位置),其他mybatis的属性都可以在这里设置-->
</configuration>

2017.4.28 SSM框架搭建与配置的更多相关文章

  1. SSM框架搭建web服务器实现登录功能(Spring+SpringMVC+Mybatis)

    初学java EE,虽然知道使用框架会使开发更加便捷高效,但是对于初学者来说,感到使用框架比较迷惑,尤其是各种jar包的引用.各种框架的配置.注解的使用等等. 最好的学习方法就是实践,于是下载了一个现 ...

  2. SpringMVC笔记——SSM框架搭建简单实例

    落叶枫桥 博客园 首页 新随笔 联系 订阅 管理 SpringMVC笔记——SSM框架搭建简单实例 简介 Spring+SpringMVC+MyBatis框架(SSM)是比较热门的中小型企业级项目开发 ...

  3. ssm框架搭建整合测试

    下载各种jar包 mybatis下载 https://github.com/mybatis/mybatis-3/releases mysql驱动下载 http://mvnrepository.com/ ...

  4. SSM 框架搭建

    SSM框架搭建(Spring.SpringMVC.Mybatis) 一:基本概念 Spring :      Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框 ...

  5. 简单的SSM框架搭建教程

    简单的ssm框架的搭建和配置文件 ssm框架里边的配置: 1.src路径下直接存放数据库和log4j的properties文件 2.src路径下建个config包,分别放置ssm的xml文件 3.修改 ...

  6. SSM框架搭建教程(从零开始,图文结合)

    1.准备 IntelliJ IDEA Tomcat JDK Maven mysql spring.springmvc.mybatis 了解 现在假设如上条件你都具备,那么通过我这篇博客 你一定可以整合 ...

  7. 实习小结(二)--- SSM框架搭建

    SSM项目框架搭建 前几天做了一个学生信息管理的项目,使用纯控制台输入,查询数据库,将信息在控制台中打印,功能完善得差不多之后,老师让将这个项目移植到Web中,使用Spring+SpringMVC+M ...

  8. SSM框架搭建详细解析

    总结了一下搭建SSM框架流程,在以后用到的时候方便回头使用. 使用工具:MyEclipse 2015:Tomcat 8版本:jdk1.8版本. 首先: 1:创建一个WebProject项目,jdk1. ...

  9. idea ssm框架搭建

    1.分享一篇完整的ssm框架搭建连接 大牛博客:https://www.cnblogs.com/toutou/p/ssm_spring.html#_nav_0 2.我的搭建的完整项目连接,可以进入我的 ...

随机推荐

  1. firefox解决flash崩溃

    1.地址栏输入 about:config 2.查找dom.ipc.plugins.flash.subprocess.crashreporter.enabled 更改为false

  2. 用Java画QRCode二维码

    支付宝.微信扫码支付的二维码,第三方的类库QRCode.jar 还是很好用的.下面贴出来这个东东生成二维码的代码. 使用时注意包括图片地址.编码内容.图片属性等几个参数,支付宝的它们的扫码回调地址. ...

  3. YYH的积木(NOIP模拟赛Round 6)

    题目描述 YYH手上有n盒积木,每个积木有个重量.现在他想从每盒积木中拿一块积木,放在一起,这一堆积木的重量为每块积木的重量和.现在他想知道重量最少的k种取法的重量分别是多少. 输入输出格式 输入格式 ...

  4. Codeforces #105 DIV2 ABCDE

    开始按照顺序刷刷以前的CF. #include <map> #include <set> #include <list> #include <cmath> ...

  5. windows下利用线程池完成多任务的分配和运行

    在做项目的过程中有时候为了提升效率,用了多线程的方法来对任务进行分割和应用,后来发现,采用线程池的方法能更好的利用线程资源来计算任务,网上有很多关于如何运行线程池的例子,msdn上也给出了对应的例子: ...

  6. 关于python浮点数的精度问题。

    若想严格按照四舍五入进行,可使用Decimal,代码如下: from decimal import Decimal, ROUND_HALF_UP def round(x, n): return Dec ...

  7. hdu 5125(LIS变形)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5125 题解: 这个题dp[i][0],dp[i][1]数组分别记录在第i个位置取a[i]和b[i]时 ...

  8. 推荐一本迷你中文书《JavaScript Promise迷你书(中文版)》

    https://github.com/azu/promises-book http://it-ebooks24.com/ebook/mastering-javascript-promises 传值,调 ...

  9. XML签名

    英文:https://www.javacodegeeks.com/2013/10/xml-security-with-digital-signature-in-java.html 中文:http:// ...

  10. #420 Div2 C

    #420 Div2 C 题意 不断把数加入到一个栈里,取数的时候要求按照 1~n 的顺序取数,每次取数保证数一定在栈里,如果要取的数不在栈头,可以选择对栈排序一次.问最少排序几次. 分析 只要栈头的数 ...