2017.4.28 SSM框架搭建与配置
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框架搭建与配置的更多相关文章
- SSM框架搭建web服务器实现登录功能(Spring+SpringMVC+Mybatis)
初学java EE,虽然知道使用框架会使开发更加便捷高效,但是对于初学者来说,感到使用框架比较迷惑,尤其是各种jar包的引用.各种框架的配置.注解的使用等等. 最好的学习方法就是实践,于是下载了一个现 ...
- SpringMVC笔记——SSM框架搭建简单实例
落叶枫桥 博客园 首页 新随笔 联系 订阅 管理 SpringMVC笔记——SSM框架搭建简单实例 简介 Spring+SpringMVC+MyBatis框架(SSM)是比较热门的中小型企业级项目开发 ...
- ssm框架搭建整合测试
下载各种jar包 mybatis下载 https://github.com/mybatis/mybatis-3/releases mysql驱动下载 http://mvnrepository.com/ ...
- SSM 框架搭建
SSM框架搭建(Spring.SpringMVC.Mybatis) 一:基本概念 Spring : Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框 ...
- 简单的SSM框架搭建教程
简单的ssm框架的搭建和配置文件 ssm框架里边的配置: 1.src路径下直接存放数据库和log4j的properties文件 2.src路径下建个config包,分别放置ssm的xml文件 3.修改 ...
- SSM框架搭建教程(从零开始,图文结合)
1.准备 IntelliJ IDEA Tomcat JDK Maven mysql spring.springmvc.mybatis 了解 现在假设如上条件你都具备,那么通过我这篇博客 你一定可以整合 ...
- 实习小结(二)--- SSM框架搭建
SSM项目框架搭建 前几天做了一个学生信息管理的项目,使用纯控制台输入,查询数据库,将信息在控制台中打印,功能完善得差不多之后,老师让将这个项目移植到Web中,使用Spring+SpringMVC+M ...
- SSM框架搭建详细解析
总结了一下搭建SSM框架流程,在以后用到的时候方便回头使用. 使用工具:MyEclipse 2015:Tomcat 8版本:jdk1.8版本. 首先: 1:创建一个WebProject项目,jdk1. ...
- idea ssm框架搭建
1.分享一篇完整的ssm框架搭建连接 大牛博客:https://www.cnblogs.com/toutou/p/ssm_spring.html#_nav_0 2.我的搭建的完整项目连接,可以进入我的 ...
随机推荐
- classpath: spring 中的查找方式
Spring可以通过指定classpath*:与classpath:前缀加路径的方式从classpath加载文件,如bean的定义文件.classpath*:的出现是为了从多个jar文件中加载相同的文 ...
- OwnCloud 搭建
owncloud 的安装方式可以在 [ 官网 ] 找到. 本文会说明 owncloud 在 CentOS 7.x 上基于 LAMP 安装, 以及简单的用 docker 镜像启动的例子. 基于 LAMP ...
- Hibernate中用注解配置一对多双向关联和多对一单向关联
Hibernate中用注解配置一对多双向关联和多对一单向关联 Hibernate提供了Hibernate Annotations扩展包,使用注解完成映射.在Hibernate3.3之前,需单独下载注解 ...
- c# tcplistener 与 client通信 服务端 今天写一下
using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Lin ...
- LayoutInflater学习总结
----参考,转载,借用来源:http://blog.csdn.net/guolin_blog/article/details/12921889 Activity类中onCreate方法中,setCo ...
- sqlite3数据库 sqlite3_get_table
上一篇介绍的sqlite3_exec 是使用回调来执行对select结果的操作.还有一个方法可以直接查询而不需要回调.但是,我个人感觉还是回调好,因为代码可以更加整齐,只不过用回调很麻烦,你得声明一个 ...
- flask框架基本使用(4)(钩子函数,异常,命令行运行)
flask 框架基本使用(1):https://www.cnblogs.com/chichung/p/9756935.html flask 框架基本使用(2):https://www.cnblogs. ...
- python爬虫beautifulsoup4系列2【转载】
本篇转自博客:上海-悠悠 原文地址:http://www.cnblogs.com/yoyoketang/tag/beautifulsoup4/ 前言 本篇详细介绍beautifulsoup4的功能,从 ...
- 设计模式原则总结--读《大话设计模式》有感 <转>
读了<大话设计模式>,摘录该书中讲到的设计模式几大原则,供日后使用. 一.单一职责原则 就一个类而言,应该仅有一个引起它变化的原因.如果一个类承担的职责过多,就等于把这些职责耦合在一起,一 ...
- 关于asp.net中gridview的问题,关于footer,16aspx上下的英语交流网程序,管理员的添加和修改有问题
css部分 这是添加用户的方法 但是A.AdminName 和后面的A.取到的都是空值protected void GridView1_RowCommand(object sender,GridVie ...