资源下载:https://download.csdn.net/download/weixin_44893902/45598347

练习点设计:模糊查询、删除、新增

一、语言和环境

  1. 实现语言:JAVA语言。
  2. 环境要求:MyEclipse/Eclipse + Tomcat + MySql。
  3. 使用技术:Jsp+Servlet+JavaBeanSpringMVC + Spring + Mybatis

二、实现功能

随着信息技术的高速发展,各部门对于图书管理方式不一,现需要制作图书资源管理系统,主要功能如下:

  1. 首页默认显示所有图书资源,如图所示。

  2. 鼠标悬停某行数据时,该行数据突出显示效果,如图所示。

  3. 用户输入“书籍名称”字段,点击搜索按钮完成模糊查询,显示查询结果,如图所示。

  4. 用户点击删除,则弹出提示框,用户点击确定后,删除选中数据并显示最新数据,如图所示。


    5.用户点击“新增”链接,则打开新增页面,填写完相关信息后点击添加按钮,增加图书资源信息数据到数据库,且页面跳转到列表页面展示最新数据,如图6和图7所示。

三、数据库设计

  1. 创建数据库(book_manage)。
  2. 创建数据表(tb_book),结构如下。
字段名 说明 字段类型 长度 备注
id 编号 int 主键,自增,增量为1
name 书籍名称 varchar 50 不能为空
author 作者 varchar 10 不能为空
publish_date 出版日期 date 不能为空
press 出版社 varchar 50 不能为空

四、推荐实现步骤

  1. SSM版本的实现步骤如下:
    (1)创建数据库和数据表,添加测试数据(至少添加5条测试数据)。
    (2)创建Web工程并创建各个包,导入工程所需的jar文件。
    (3)添加相关SSM框架支持。
    (4)配置项目所需要的各种配置文件(mybatis配置文件、spring配置文件、springMVC配置文件)。
    (5)创建实体类。
    (6)创建MyBatis操作数据库所需的Mapper接口及其Xml映射数据库操作语句文件。
    (7)创建业务逻辑相应的接口及其实现类,实现相应的业务,并在类中加入对DAO/Mapper的引用和注入。
    (8)创建Controller控制器类,在Controller中添加对业务逻辑类的引用和注入,并配置springMVC配置文件。
    (9)创建相关的操作页面,并使用CSS对页面进行美化。
    (10)实现页面的各项操作功能,并在相关地方进行验证,操作要人性化。
    (11)调试运行成功后导出相关的数据库文件并提交。

五、实现代码

1、MySQL数据库

book_manage.sql

/*
Date: 04/08/2021 20:51:19
*/ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------
-- Table structure for tb_book
-- ----------------------------
DROP TABLE IF EXISTS `tb_book`;
CREATE TABLE `tb_book` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`author` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`publish_date` date NULL DEFAULT NULL,
`press` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ----------------------------
-- Records of tb_book
-- ----------------------------
INSERT INTO `tb_book` VALUES (1, '向往的生活', '张强', '1990-01-01', '科学出版社');
INSERT INTO `tb_book` VALUES (2, '幸福的生活', '李辉', '2006-06-05', '高等教育出版社');
INSERT INTO `tb_book` VALUES (3, '这一生这么过', '郭强铭', '2021-08-10', '大百科全书出版社');
INSERT INTO `tb_book` VALUES (4, '爱的教育', '张德旭', '1992-06-20', '高等教育出版社'); SET FOREIGN_KEY_CHECKS = 1;

2、项目Java代码

目录结构
book_manage

JAR包:

src

com.controller

BookMapperController.java

package com.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import com.entity.TbBook;
import com.service.impl.BookManageService; @Controller
public class BookMapperController {
@Resource
BookManageService service;
@RequestMapping("/selectAll")
public ModelAndView selectAll(String name) {
ModelAndView modelAndView = new ModelAndView();
if (name==null||name.equals("")) {
name="";
}
List<TbBook> tbBookList=service.selectAll(name);
modelAndView.setViewName("tbBook");
modelAndView.addObject("tbBookList", tbBookList);
return modelAndView;
}
//娣诲姞
@RequestMapping("/jump")
public String jump() {
return "addTbBook";
}
@RequestMapping("/insertTbBook")
public String insertTbBook(TbBook tbBook) {
int add=service.insertTbBook(tbBook);
return "redirect:/selectAll.do"; }
//鍒犻櫎
@RequestMapping("/delTbBook")
public String delTbBook(int id) {
int del=service.delTbBook(id);
return "redirect:/selectAll.do";
}
}

com.dao

TbBookMapper.java

package com.dao;

import com.entity.TbBook;
import java.util.List; public interface TbBookMapper {
int deleteByPrimaryKey(Integer id); int insert(TbBook record); TbBook selectByPrimaryKey(Integer id); List<TbBook> selectAll(); int updateByPrimaryKey(TbBook record); List<TbBook> likeSelect(String name);
}

TbBookMapper.xml

<?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.dao.TbBookMapper" >
<resultMap id="BaseResultMap" type="com.entity.TbBook" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="author" property="author" jdbcType="VARCHAR" />
<result column="publish_date" property="publishDate" jdbcType="DATE" />
<result column="press" property="press" jdbcType="VARCHAR" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from tb_book
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.entity.TbBook" >
insert into tb_book (id, name, author,
publish_date, press)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
#{publishDate,jdbcType=DATE}, #{press,jdbcType=VARCHAR})
</insert>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select id, name, author, publish_date, press
from tb_book
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap" >
select id, name, author, publish_date, press
from tb_book
</select>
<select id="likeSelect" resultMap="BaseResultMap" >
select id, name, author, publish_date, press
from tb_book where `name` LIKE "%"#{name}"%"
</select>
</mapper>

com.entity

TbBook.java

package com.entity;

import java.util.Date;

public class TbBook {
private Integer id; private String name; private String author; private String publishDate; private String press; public Integer getId() {
return id;
} public void setId(Integer id) {
this.id = id;
} public String getName() {
return name;
} public void setName(String name) {
this.name = name == null ? null : name.trim();
} public String getAuthor() {
return author;
} public void setAuthor(String author) {
this.author = author == null ? null : author.trim();
} public String getPublishDate() {
return publishDate;
} public void setPublishDate(String publishDate) {
this.publishDate = publishDate;
} public String getPress() {
return press;
} public void setPress(String press) {
this.press = press == null ? null : press.trim();
}
}

com.generator

Generator.java

package com.generator;

import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.exception.InvalidConfigurationException;
import org.mybatis.generator.exception.XMLParserException;
import org.mybatis.generator.internal.DefaultShellCallback; public class Generator {
/*
* targetRuntime="MyBatis3Simple", 不生成Example
*/
public void generateMyBatis() {
// MBG执行过程中的警告信息
List<String> warnings = new ArrayList<String>();
// 当生成的代码重复时,覆盖原代码
boolean overwrite = true;
String generatorFile = "/generator/generatorConfig.xml";
// String generatorFile = "/generator/generatorConfigExample.xml";
// 读取MBG配置文件
InputStream is = Generator.class.getResourceAsStream(generatorFile); ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config;
try {
config = cp.parseConfiguration(is);
DefaultShellCallback callback = new DefaultShellCallback(overwrite);
// 创建MBG
MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
// 执行生成代码
myBatisGenerator.generate(null);
} catch (IOException e) {
e.printStackTrace();
} catch (XMLParserException e) {
e.printStackTrace();
} catch (InvalidConfigurationException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
for (String warning : warnings) {
System.out.println(warning);
}
} public static void main(String[] args) {
Generator generator = new Generator();
generator.generateMyBatis();
}
}

com.service.impl

BookManageService.java

package com.service.impl;

import java.util.List;

import com.entity.TbBook;

public interface BookManageService {
List<TbBook> selectAll(String name); int insertTbBook(TbBook tbBook); int delTbBook(int id); }

BookManageServiceImpl.java

package com.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dao.TbBookMapper;
import com.entity.TbBook; @Service
public class BookManageServiceImpl implements BookManageService {
@Resource
TbBookMapper mapper;
@Override
public List<TbBook> selectAll(String name) {
if (name.equals("")|| name==null) {
List<TbBook> list=mapper.selectAll();
return list;
}else {
List<TbBook> list=mapper.likeSelect(name);
return list;
}
}
@Override
public int insertTbBook(TbBook tbBook) {
int add=mapper.insert(tbBook);
return add;
}
@Override
public int delTbBook(int id) {
int del=mapper.deleteByPrimaryKey(id);
return del;
} }

MyBatis

SqlMapConfig.xml

<?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>
<!-- 别名 -->
<typeAliases>
<package name="com.entity"/>
</typeAliases>
</configuration>

spring

applicationContext-dao.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd ">
<context:property-placeholder location="classpath:dataSource.properties"/>
<!-- 数据源配置 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="${db.driverClass}"></property>
<property name="Url" value="${db.jdbcUrl}"></property>
<property name="username" value="${db.user}"></property>
<property name="password" value="${db.password}"></property>
</bean>
<!-- 配置SqlSessionFactory -->
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 设置MyBatis核心配置文件 -->
<property name="configLocation" value="classpath:MyBatis/SqlMapConfig.xml"></property>
<!-- 设置数据源 -->
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- 配置Mapper扫描 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 设置Mapper扫描包 -->
<property name="basePackage" value="com.dao"></property>
</bean>
</beans>

applicationContext-service.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd "> <!-- 配置Service层扫描 -->
<context:component-scan base-package="com.service"></context:component-scan>
<!-- 配置事务管理层 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- 开启注解方式管理AOP事务 -->
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>

spring-mvc.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd "> <!-- 配置Controller层扫描包 -->
<context:component-scan base-package="com.controller"></context:component-scan>
<!-- 配置注解驱动 -->
<mvc:annotation-driven></mvc:annotation-driven>
<!-- 配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix" value="/WEB-INF/jsp"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>

dataSource.properties

db.driverClass=com.mysql.jdbc.Driver
db.jdbcUrl=jdbc:mysql://127.0.0.1:3306/person_db?useUnicode=true&characterEncoding=UTF-8&useSSL=false
db.user=root
db.password=123456

generatorConfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<!-- 配置生成器 -->
<generatorConfiguration>
<context id="MySQLContext" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<!-- 配置前置分隔符和后置分隔符 -->
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<!-- 配置注释信息 -->
<commentGenerator>
<!-- 不生成注释 -->
<property name="suppressAllComments" value="true"/>
<property name="suppressDate" value="true"/>
<property name="addRemarkComments" value="true"/>
</commentGenerator>
<!-- 数据库连接配置 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/book_manage"
userId="root" password="123456">
</jdbcConnection> <!-- targetPackage:生成实体类存放的包名, targetProject:指定目标项目路径,可以使用相对路径或绝对路径 -->
<javaModelGenerator targetPackage="com.entity" targetProject="src">
<property name="trimStrings" value="true"/>
</javaModelGenerator> <!-- 配置SQL映射器Mapper.xml文件的属性 -->
<sqlMapGenerator targetPackage="com.dao" targetProject="src"/> <!-- type="XMLMAPPER":所有的方法都在XML中,接口调用依赖XML文件 -->
<javaClientGenerator targetPackage="com.dao" type="XMLMAPPER"
targetProject="src"/> <!-- 生成所有表的映射 -->
<table tableName="%"></table>
</context>
</generatorConfiguration>

WebContent

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>com.ssm.crm.system</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<!--spring容器 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/applicationContext-*.xml</param-value>
</context-param>
<!-- 监听器,加载spring配置 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 前端控制器 -->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.do</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>
</web-app>

JSP

index.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body> <script type="text/javascript">
window.location.href="selectAll.do";
</script>
</body>
</html>

addTbBook.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="insertTbBook.do">
<div>
<table border="1" style="border-collapse: collapse;text-align: center;margin: 0 auto;">
<tr>
<td>书籍名称</td>
<td>
<input type="text" name="name" value="${tbBook.name }">
</td>
</tr>
<tr>
<td>作者:</td>
<td>
<input type="text" name="author" value="${tbBook.author }">
</td>
</tr>
<tr>
<td>出版日期:</td>
<td>
<input type="date" name="publishDate" value="${tbBook.publishDate }">
</td>
</tr>
<tr>
<td>出版社:</td>
<td>
<input type="text" name="press" value="${tbBook.press }">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="添加">
<input type="reset" value="重置">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

tbBook.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<style>
*{
margin: 0;padding: 0;
}
table,td,th{
border-collapse: collapse;
border-spacing: 0;
}
table{
width: 60%;
margin: 0 auto;
}
td,th{
padding: 5px 10px;
border: 1px solid black;
}
.form{
width:60%;
padding:10px;
margin: 0 auto;
}
fieldset{
border: 1px solid black;
padding: 10px
} </style>
<body>
<div>
<div class="form">
<form action="selectAll.do">
<fieldset>
<legend class="le">搜索</legend>
书籍名称:<input type="text" placeholder="请输入名称搜索" name="name" />
<button type="submit">查询</button>
</fieldset>
</form>
</div>
<table border="1" style="border-collapse: collapse;text-align: center;margin: 0 auto;">
<tr>
<th>编号</th>
<th>书籍名称</th>
<th>作者</th>
<th>出版日期</th>
<th>出版社</th>
<th>操作</th>
</tr>
<c:forEach items="${tbBookList }" var="tbBook" varStatus="items">
<tr>
<td>${tbBook.id }</td>
<td>${tbBook.name }</td>
<td>${tbBook.author }</td>
<td>${tbBook.publishDate }</td>
<td>${tbBook.press }</td>
<td><a onclick="del(${tbBook.id })">删除</a></td>
</tr> </c:forEach>
<tr>
<td colspan="6" style="text-align: right;">共计:${tbBookList.size()}条数据,<a href="jump.do">新增</a></td> </tr>
</table>
<script type="text/javascript">
function del(id){
if(confirm("确认要删除吗?")){
return window.location.href="delTbBook.do?id="+id;
}else {
return false;
}
}
</script>
</div>
</body>
</html>

基于Spring MVC + Spring + MyBatis的【图书资源管理系统】的更多相关文章

  1. 基于Spring MVC + Spring + MyBatis的【医院就诊挂号系统】

    资源下载:https://download.csdn.net/download/weixin_44893902/21727306 一.语言和环境 1.实现语言: JAVA语言. 2.环境要求: MyE ...

  2. Spring、Spring MVC、MyBatis

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

  3. 转载 Spring、Spring MVC、MyBatis整合文件配置详解

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

  4. freemarker + spring mvc + spring + mybatis + mysql + maven项目搭建

    今天说说搭建项目,使用freemarker + spring mvc + spring + mybatis + mysql + maven搭建web项目. 先假设您已经配置好eclipse的maven ...

  5. IDEA下创建Maven项目,并整合使用Spring、Spring MVC、Mybatis框架

    项目创建 本项目使用的是IDEA 2016创建. 首先电脑安装Maven,接着打开IDEA新建一个project,选择Maven,选择图中所选项,下一步. 填写好GroupId和ArtifactId, ...

  6. Spring MVC+Spring+Mybatis+MySQL(IDEA)入门框架搭建

    目录 Spring MVC+Spring+Mybatis+MySQL(IDEA)入门框架搭建 0.项目准备 1.数据持久层Mybatis+MySQL 1.1 MySQL数据准备 1.2 Mybatis ...

  7. spring MVC、mybatis配置读写分离

    spring MVC.mybatis配置读写分离 1.环境: 3台数据库机器,一个master,二台slave,分别为slave1,slave2 2.要实现的目标: ①使数据写入到master ②读数 ...

  8. spring mvc与mybatis收集到博客

    mybaits-spring 官方教程 http://mybatis.github.io/spring/zh/ SpringMVC 基础教程 框架分析 http://blog.csdn.net/swi ...

  9. Spring MVC程序中得到静态资源文件css,js,图片文件的路径问题总结

    上一篇 | 下一篇 Spring MVC程序中得到静态资源文件css,js,图片 文件的路径 问题总结 作者:轻舞肥羊 日期:2012-11-26 http://www.blogjava.net/fi ...

随机推荐

  1. 零基础学习java------40---------Maven(maven的概念,安装,maven在eclipse中使用),springboot(spring整合springmvc(注解),spring整合mybatis(常见的配置文件)),前端页面(bootstrap软件)

    一 maven 1. Maven的相关概念 1.1 项目开发中遇到的问题 (1)都是同样的代码,为什么在我的机器上可以编译执行,而在他的机器上就不行? (2)为什么在我的机器上可以正常打包,而配置管理 ...

  2. 【leetcode】43. Multiply Strings(大数相乘)

    Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and ...

  3. 编程之美Q1

    题目 和数书页有点类似,就直接数吧 #include<iostream> using namespace std; class q1 { public: size_t func(size_ ...

  4. Linux磁盘分区(一)之fdisk命令

    Linux磁盘分区(一)之fdisk命令转自:https://www.cnblogs.com/machangwei-8/p/10353683.html 一.fdisk 的介绍fdsik 能划分磁盘成为 ...

  5. @FeignClient同一个name,多个配置类的解决方案

    概述   我使用的spring-cloud-starter-openfeign的版本是2.0.0,然后使用@FeignClient的时候是不能一个name多个配置类的,后来也是从网络查找了各种网友的方 ...

  6. 深入 char

    深入 char * ,char ** ,char a[ ] ,char *a[] 内核分类: c语言 2013-02-23 15:34 15176人阅读 评论(8) 收藏 举报Charcharchar ...

  7. Spring Batch(0)——控制Step执行流程

    Conditional Flow in Spring Batch I just announced the new Learn Spring course, focused on the fundam ...

  8. Java RestTemplate传递参数

    最近使用Spring 的 RestTemplate 工具类请求接口的时候发现参数传递的一个坑,也就是当我们把参数封装在Map里面的时候,Map 的类型选择. 使用RestTemplate post请求 ...

  9. Game On Serverless:SAE 助力广州小迈提升微服务研发效能

    作者:洛浩 小迈于 2015 年 1 月成立,是一家致力以数字化领先为优势,实现业务高质量自增长的移动互联网科技公司.始终坚持以用户价值为中心,以数据为驱动,为用户开发丰富的工具应用.休闲游戏.益智. ...

  10. 人工水母搜索算法—matlab代码

    clc clear foj = @ Sphere; Lb = -100; % 搜索空间下界 Ub = 100; % 搜索空间上界 N_iter = 1000; % 最大迭代次数 n_pop = 50; ...