java ssm框架_JavaWeb开发SSM框架搭建详解
1.需要用到的jar包:由于很多的jar包不好下载,我直接上传到百度网盘:
很多,而且不好下载,我已经整理好好了:
关于SSM框架:以前的博客有介绍过
第一步:创建Dynamic Web Project
首先是整合之后的目录结构:
需要我们关注的只是我红线画出的:
先把所有的jar包复制入lib文件夹:不同于传统java项目,这里会自动build path,总之复制进去就完事了
关于mybatis和spring的配置文件,分别在两个文件夹中:
首先来配置mybatis:SqlMapConfig.xml:
/p>
"http://mybatis.org/dtd/mybatis-3-config.dtd">
配置Spring:
Dao层:applicationContext-dao.xml
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
Service层:applicationContext-service.xml:
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
配置SpringMVC:springmvc.xml
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
接下来就算最关键的一步:web.xml配置
SSM
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
contextConfigLocation
classpath:spring/applicationContext-*.xml
org.springframework.web.context.ContextLoaderListener
encoding
org.springframework.web.filter.CharacterEncodingFilter
encoding
UTF-8
encoding
/*
ssm
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:spring/springmvc.xml
1
ssm
/
其余的杂项配置:
1.数据库配置:用户名,数据库名,连接配置等等
jdbc.properties:
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssm?characterEncoding=utf-8
jdbc.username=root
jdbc.password=root
2.日志文件配置:
log4j.properties:
# Global logging configuration
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
3.至于resource.properties是后边项目需要的,和SSM框架无关
最后:Get方式乱码修改方式:
打开Tomcat的配置文件修改一个URIEncoding属性
java ssm框架_JavaWeb开发SSM框架搭建详解相关推荐
- java lombok 视频_Java开发神器Lombok使用详解
最近正在写SpringBoot系列文章和录制视频教程,每次都要重复写一些Getter/Setter.构造器方法.字符串输出的ToString方法和Equals/HashCode方法等.甚是浪费时间,也 ...
- java me基础教程 pdf_Java ME手机应用开发技术与案例详解 PDF
资源名称:Java ME手机应用开发技术与案例详解 PDF Java ME手机应用开发技术与案例详解基于Java ME,系统描述了Java ME手机应用开发的各个方面.全书按照Java ME程序的开发 ...
- JAVA SpringBlade 微服务开发平台框架,企业级的SaaS多租户微服务平台,基于Spring Boot 2.7
SpringBlade微服务开发平台 完整代码下载地址:JAVA SpringBlade 微服务开发平台框架,企业级的SaaS多租户微服务平台 采用前后端分离的模式,前端开源两个框架:Sword (基 ...
- Java开发环境搭建详解
Java开发环境搭建详解 http://topic.csdn.net/u/20110829/13/BF4FAA45-3E1A-48A8-BC46-0405B7F862A2.html 一.jdk安装与 ...
- Java开发常见面试题详解(LockSupport,AQS,Spring循环依赖,Redis)_3
Java开发常见面试题详解(LockSupport,AQS,Spring循环依赖,Redis)_3 总览 问题 详解 String.intern()的作用 link LeetCode的Two Sum题 ...
- Java开发常见面试题详解(JVM)_2
Java开发常见面试题详解(JVM)_2 JVM 问题 详解 JVM垃圾回收的时候如何确定垃圾?是否知道什么是GC Roots link 你说你做过JVM调优和参数配置,请问如何盘点查看JVM系统默认 ...
- php事件和行为,Yii框架组件和事件行为管理详解
Yii框架组件和事件行为管理详解 来源:中文源码网 浏览: 次 日期:2018年9月2日 [下载文档: Yii框架组件和事件行为管理详解.txt ] (友情提示:右键点上行txt文档名- ...
- 三大框架题目整合考试题(含详解)
三大框架题目整合考试题(含详解) 1.在Hibernate的关联关系映射配置中,下列选项对于inverse说法错误的是(bd). (选择二项) A. inverse属性指定了关联关系中的方向 //in ...
- 《Android 网络开发与应用实战详解》——1.3节搭建Android应用开发环境
本节书摘来自异步社区<Android 网络开发与应用实战详解>一书中的第1章,第1.3节搭建Android应用开发环境,作者 王东华,更多章节内容可以访问云栖社区"异步社区&qu ...
最新文章
- 【WEB API项目实战干货系列】- API登录与身份验证(三)
- python变量初始化的位置不当、程序结果可能会出现问题_解决tensorflow由于未初始化变量而导致的错误问题...
- R有序因子和无序因子(4)
- 国土空间适宜性评价与承载力评价之间的逻辑关系是什么?
- MySQL5.5安装到最后一步卡住的解决办法(即使删除了隐藏文件内C:\ProgramData的MySQL以后还是没解决问题)
- php监考,科学网—监考与被监考 - 张珑的博文
- 诊断Oracle 服从成绩
- hbase java client 简介_hbase Java client(Release 1.0)
- 做对了什么与留下了什么 小米上市的背后
- Foundation框架之字符串和日期
- 服务器系统访问量统计,通过网站统计或系统监视器查看IIS并发连接数
- 中产移民:很难找到好工作。
- 自定义 rest_framework 响应返回格式
- php布尔教育,布尔教育2016PHP加强视频教程
- IC电源去耦原理及滤波元件选型
- Ubuntu LiveSuit V3.06不能烧写问题
- 如何应对用智行火车票购买机票后的高额退改手续费???
- 桂院导航小程序开发笔记
- 组合递推公式证明(杨辉三角)
- php后台结构,信呼后台结构