整合需要的jar包和源码将在文末给出

本文参考黑马程序员视频,由于视频用的环境和我使用的环境不同,建议使用我的环境及jar包(比较新)

一 整合思路

第一步 整合dao层

mybatis和spring整合,通过spring管理mapper接口:使用mapper扫描器自动扫描mapper接口在spring中进行注册

第二部 整合service层

通过spring管理service接口

使用配置方式将service接口配置在spring配置文件中。

实现事务控制

第三步:整合spring'mvc

由于springmvc是spring的模块,不需要整合。

二 准备环境:

java环境:

mysql 5.5

本文的例子只使用到了items表,故给出items字段,可根据一下查询结果建表和插入数据

所有jar包将在文末给出

工程结构:

三 程序编写

1 整合dao(持久层)  mybatis和spring进行整合

mybatis全局配置文件 sqlMapConfig.xml

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE configuration
  3. PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-config.dtd">
  5. <configuration>
  6. <!-- 配置mapper
  7. 由于使用spring和mybatis整合后使用mapper扫描这里不需要配置。
  8. 必须遵循:mapper.xml和maapper.java文件同名且在同一个目录
  9. -->
  10. </configuration>

spring配置文件 applicationContext-dao.xml

配置:数据源,SqlSessionFactory mapper扫描器

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:mvc="http://www.springframework.org/schema/mvc"
  7. xmlns:task="http://www.springframework.org/schema/task"
  8. xmlns:tx="http://www.springframework.org/schema/tx"
  9. xsi:schemaLocation="http://www.springframework.org/schema/beans
  10. http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
  11. http://www.springframework.org/schema/context
  12. http://www.springframework.org/schema/context/spring-context-4.2.xsd
  13. http://www.springframework.org/schema/mvc
  14. http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
  15. http://www.springframework.org/schema/task
  16. http://www.springframework.org/schema/task/spring-task-4.2.xsd
  17. http://www.springframework.org/schema/tx
  18. http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
  19.  
  20. <!-- 加载db.properties文件 -->
  21. <context:property-placeholder location="classpath:db.properties"/>
  22.  
  23. <!-- dbcp数据库连接池 -->
  24. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  25. <property name="driverClassName" value="${jdbc.driver}"/>
  26. <property name="url" value="${jdbc.url}"/>
  27. <property name="username" value="${jdbc.username}"/>
  28. <property name="password" value="${jdbc.password}"/>
  29. <property name="maxActive" value="30"/>
  30. <property name="maxIdle" value="5"/>
  31. </bean>
  32. <!-- 让spring管理sqlsessionfactory 使用mybatis和spring整合包中的 -->
  33. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  34. <!-- 数据库连接池 -->
  35. <property name="dataSource" ref="dataSource" />
  36. <!-- 加载mybatis的全局配置文件 -->
  37. <property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml" />
  38. </bean>
  39.  
  40. <!-- mapper扫描器 -->
  41. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  42. <property name="basePackage" value="pers.czs.ssm.mapper"></property>
  43. <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
  44. </bean>
  45. </beans>

定义po类Items.clss,ItemsCustom.class,ItemsQueryVo.class,其中ItemsCustom.class和ItemsQueryVo.class是Items.clss的扩展类,用于后面编写mapper.xml文件中的输入和输出映射

  1. package pers.czs.ssm.po;
  2.  
  3. import java.util.Date;
  4.  
  5. public class Items {
  6. private int id;
  7. private String name;
  8. private float price;
  9. private String detail;
  10. private String pic;
  11. private Date createtime;
  12. public int getId() {
  13. return id;
  14. }
  15. public void setId(int id) {
  16. this.id = id;
  17. }
  18. public String getName() {
  19. return name;
  20. }
  21. public void setName(String name) {
  22. this.name = name;
  23. }
  24. public float getPrice() {
  25. return price;
  26. }
  27. public void setPrice(float price) {
  28. this.price = price;
  29. }
  30. public String getDetail() {
  31. return detail;
  32. }
  33. public void setDetail(String detail) {
  34. this.detail = detail;
  35. }
  36. public String getPic() {
  37. return pic;
  38. }
  39. public void setPic(String pic) {
  40. this.pic = pic;
  41. }
  42. public Date getCreatetime() {
  43. return createtime;
  44. }
  45. public void setCreatetime(Date createtime) {
  46. this.createtime = createtime;
  47. }
  48. }
  1. package pers.czs.ssm.po;
  2.  
  3. public class ItemsCustom extends Items{
  4.  
  5. }
  1. package pers.czs.ssm.po;
  2.  
  3. public class ItemsQueryVo {
  4. private Items items;
  5.  
  6. private ItemsCustom itemsCustom;
  7.  
  8. public Items getItems() {
  9. return items;
  10. }
  11.  
  12. public void setItems(Items items) {
  13. this.items = items;
  14. }
  15.  
  16. public ItemsCustom getItemsCustom() {
  17. return itemsCustom;
  18. }
  19.  
  20. public void setItemsCustom(ItemsCustom itemsCustom) {
  21. this.itemsCustom = itemsCustom;
  22. }
  23.  
  24. }

定义ItemsMapper.xmlItemsMapper.java

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="pers.czs.ssm.mapper.ItemsMapper">
  6.  
  7. <!-- sql片段 -->
  8. <!-- 商品查询条件 -->
  9. <sql id="query_items_where">
  10. <if test="itemsCustom!=null">
  11. <if test="itemsCustom.name!=null and itemsCustom.name!=''">
  12. and items.name like '%${itemsCustom.name}%'
  13. </if>
  14. </if>
  15. </sql>
  16.  
  17. <!-- 查询商品信息 -->
  18. <select id="findItemsList" parameterType="pers.czs.ssm.po.ItemsQueryVo"
  19. resultType="pers.czs.ssm.po.ItemsCustom">
  20. select * from items
  21. <where>
  22. <include refid="query_items_where"/>
  23. </where>
  24. </select>
  25.  
  26. </mapper>
  1. package pers.czs.ssm.mapper;
  2.  
  3. import java.util.List;
  4.  
  5. import pers.czs.ssm.po.ItemsCustom;
  6. import pers.czs.ssm.po.ItemsQueryVo;
  7.  
  8. public interface ItemsMapper {
  9. public List<ItemsCustom> findItemsList (ItemsQueryVo itemsQueryVo)throws Exception;
  10. }

2 整合service(逻辑层) 让spring管理service接口

定义service接口ItemService 和接口实现类ItemServiceImpl

  1. package pers.czs.ssm.service;
  2.  
  3. import java.util.List;
  4.  
  5. import pers.czs.ssm.po.ItemsCustom;
  6. import pers.czs.ssm.po.ItemsQueryVo;
  7.  
  8. public interface ItemsService {
  9. public List<ItemsCustom> findItemsList (ItemsQueryVo itemsQueryVo)throws Exception;
  10. }
  1. package pers.czs.ssm.service.impl;
  2.  
  3. import java.util.List;
  4.  
  5. import org.springframework.beans.factory.annotation.Autowired;
  6.  
  7. import pers.czs.ssm.mapper.ItemsMapper;
  8. import pers.czs.ssm.po.ItemsCustom;
  9. import pers.czs.ssm.po.ItemsQueryVo;
  10. import pers.czs.ssm.service.ItemsService;
  11.  
  12. public class ItemsServiceImpl implements ItemsService{
  13.  
  14. @Autowired
  15. private ItemsMapper itemsMapper;
  16.  
  17. @Override
  18. public List<ItemsCustom> findItemsList(ItemsQueryVo itemsQueryVo) throws Exception {
  19. // 通过ItemsMapper查询数据库
  20. return itemsMapper.findItemsList(itemsQueryVo);
  21. }
  22. }

在spring容器配置service(applicationContext-service.xml)

创建applicationContext-service.xml,文件中配置service。

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:mvc="http://www.springframework.org/schema/mvc"
  7. xmlns:task="http://www.springframework.org/schema/task"
  8. xmlns:tx="http://www.springframework.org/schema/tx"
  9. xsi:schemaLocation="http://www.springframework.org/schema/beans
  10. http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
  11. http://www.springframework.org/schema/context
  12. http://www.springframework.org/schema/context/spring-context-4.2.xsd
  13. http://www.springframework.org/schema/mvc
  14. http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
  15. http://www.springframework.org/schema/task
  16. http://www.springframework.org/schema/task/spring-task-4.2.xsd
  17. http://www.springframework.org/schema/tx
  18. http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
  19.  
  20. <!-- 商品管理service -->
  21. <bean id="itemsService" class="pers.czs.ssm.service.impl.ItemsServiceImpl"></bean>
  22. </beans>

事务控制 (applicationContext-transaction.xml)

applicationContext-transaction.xml中使用spring声明式事务控制方法。

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:aop="http://www.springframework.org/schema/aop"
  7. xmlns:mvc="http://www.springframework.org/schema/mvc"
  8. xmlns:task="http://www.springframework.org/schema/task"
  9. xmlns:tx="http://www.springframework.org/schema/tx"
  10. xsi:schemaLocation="http://www.springframework.org/schema/beans
  11. http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
  12. http://www.springframework.org/schema/context
  13. http://www.springframework.org/schema/context/spring-context-4.2.xsd
  14. http://www.springframework.org/schema/aop
  15. http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
  16. http://www.springframework.org/schema/mvc
  17. http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
  18. http://www.springframework.org/schema/task
  19. http://www.springframework.org/schema/task/spring-task-4.2.xsd
  20. http://www.springframework.org/schema/tx
  21. http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
  22.  
  23. <!-- 事务管理器 -->
  24. <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  25. <!-- 数据源 -->
  26. <property name="dataSource" ref="dataSource"/>
  27. </bean>
  28.  
  29. <!-- 通知 -->
  30. <tx:advice id="txAdvice" transaction-manager="transactionManager">
  31. <tx:attributes>
  32. <!-- 传播行为 -->
  33. <tx:method name="save*" propagation="REQUIRED"/>
  34. <tx:method name="insert*" propagation="REQUIRED"/>
  35. <tx:method name="delete*" propagation="REQUIRED"/>
  36. <tx:method name="update*" propagation="REQUIRED"/>
  37. <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
  38. <tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
  39. </tx:attributes>
  40. </tx:advice>
  41.  
  42. <!-- 切面 -->
  43. <aop:config>
  44. <aop:advisor advice-ref="txAdvice"
  45. pointcut="execution(* pers.czs.ssm.service.impl.*.*(..))"/>
  46. </aop:config>
  47. </beans>

3 整合springmvc

创建springmvc.xml文件,配置处理器映射器、适配器、视图解析器。

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:aop="http://www.springframework.org/schema/aop"
  7. xmlns:mvc="http://www.springframework.org/schema/mvc"
  8. xmlns:task="http://www.springframework.org/schema/task"
  9. xmlns:tx="http://www.springframework.org/schema/tx"
  10. xsi:schemaLocation="http://www.springframework.org/schema/beans
  11. http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
  12. http://www.springframework.org/schema/context
  13. http://www.springframework.org/schema/context/spring-context-4.2.xsd
  14. http://www.springframework.org/schema/aop
  15. http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
  16. http://www.springframework.org/schema/mvc
  17. http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
  18. http://www.springframework.org/schema/task
  19. http://www.springframework.org/schema/task/spring-task-4.2.xsd
  20. http://www.springframework.org/schema/tx
  21. http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
  22.  
  23. <!-- 扫描controller注解,多个包中间使用半角逗号分隔 -->
  24. <context:component-scan base-package="pers.czs.ssm.controller"/>
  25. <!--注解映射器 -->
  26. <!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/> -->
  27. <!--注解适配器 -->
  28. <!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/> -->
  29.  
  30. <!-- 使用 mvc:annotation-driven代替上边注解映射器和注解适配器配置
  31. mvc:annotation-driven默认加载很多的参数绑定方法,
  32. 比如json转换解析器就默认加载了,如果使用mvc:annotation-driven不用配置上边的RequestMappingHandlerMapping和RequestMappingHandlerAdapter
  33. 实际开发时使用mvc:annotation-driven
  34. -->
  35. <mvc:annotation-driven></mvc:annotation-driven>
  36.  
  37. <!-- ViewResolver -->
  38. <bean
  39. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  40. <property name="viewClass"
  41. value="org.springframework.web.servlet.view.JstlView" />
  42. <property name="prefix" value="/WEB-INF/jsp/" />
  43. <property name="suffix" value=".jsp" />
  44. </bean>
  45. </beans>

配置前端控制器以及加载spring容器(都是在web.xml内配置的,这里我直接给出web.xml文件代码)

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <display-name>springmvc_mybatis</display-name>
  4.  
  5. <!-- 加载spring容器 -->
  6. <context-param>
  7. <param-name>contextConfigLocation</param-name>
  8. <param-value>/WEB-INF/classes/spring/applicationContext-*.xml</param-value>
  9. </context-param>
  10. <listener>
  11. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  12. </listener>
  13.  
  14. <!-- springmvc的前端控制器 -->
  15. <servlet>
  16. <servlet-name>springmvc</servlet-name>
  17. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  18. <!-- contextConfigLocation不是必须的, 如果不配置contextConfigLocation, springmvc的配置文件默认在:WEB-INF/servlet的name+"-servlet.xml" -->
  19. <init-param>
  20. <param-name>contextConfigLocation</param-name>
  21. <param-value>classpath:spring/springmvc.xml</param-value>
  22. </init-param>
  23. <load-on-startup>1</load-on-startup>
  24. </servlet>
  25. <servlet-mapping>
  26. <servlet-name>springmvc</servlet-name>
  27. <url-pattern>*.action</url-pattern>
  28. </servlet-mapping>
  29.  
  30. <welcome-file-list>
  31. <welcome-file>index.html</welcome-file>
  32. <welcome-file>index.htm</welcome-file>
  33. <welcome-file>index.jsp</welcome-file>
  34. <welcome-file>default.html</welcome-file>
  35. <welcome-file>default.htm</welcome-file>
  36. <welcome-file>default.jsp</welcome-file>
  37. </welcome-file-list>
  38. </web-app>

编写ItemsController(就是Handler)

  1. package pers.czs.ssm.controller;
  2.  
  3. import java.util.List;
  4.  
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.stereotype.Controller;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.servlet.ModelAndView;
  9.  
  10. import pers.czs.ssm.po.ItemsCustom;
  11. import pers.czs.ssm.service.ItemsService;
  12.  
  13. @Controller
  14. public class ItemsController {
  15.  
  16. @Autowired
  17. private ItemsService itemsService;
  18.  
  19. @RequestMapping("/queryItems")
  20. public ModelAndView queryItems() throws Exception {
  21. // 调用service查找 数据库,查询商品列表
  22. List<ItemsCustom> itemsList = itemsService.findItemsList(null);
  23.  
  24. //返回ModelAndView
  25. ModelAndView modelAndView = new ModelAndView();
  26. //相当 于request的setAttribut,在jsp页面中通过itemsList取数据
  27. modelAndView.addObject("itemsList",itemsList);
  28.  
  29. //指定视图,没有配置前缀后缀
  30. //modelAndView.setViewName("/WEB-INF/jsp/items/itemsList.jsp");
  31.  
  32. //指定视图,在视图解析器中配置了前缀后缀后可以省略一些东西
  33. modelAndView.setViewName("items/itemsList");
  34.  
  35. return modelAndView;
  36. }
  37.  
  38. }

编写itemsList.jsp

  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  9. <title>查询商品列表</title>
  10. </head>
  11. <body>
  12. <form action="${pageContext.request.contextPath }/item/queryItem.action" method="post">
  13. 查询条件:
  14. <table width="100%" border=1>
  15. <tr>
  16. <td><input type="submit" value="查询"/></td>
  17. </tr>
  18. </table>
  19. 商品列表:
  20. <table width="100%" border=1>
  21. <tr>
  22. <td>商品名称</td>
  23. <td>商品价格</td>
  24. <td>生产日期</td>
  25. <td>商品描述</td>
  26. <td>操作</td>
  27. </tr>
  28. <c:forEach items="${itemsList }" var="item">
  29. <tr>
  30. <td>${item.name }</td>
  31. <td>${item.price }</td>
  32. <td><fmt:formatDate value="${item.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
  33. <td>${item.detail }</td>
  34.  
  35. <td><a href="${pageContext.request.contextPath }/item/editItem.action?id=${item.id}">修改</a></td>
  36.  
  37. </tr>
  38. </c:forEach>
  39.  
  40. </table>
  41. </form>
  42. </body>
  43.  
  44. </html>

浏览器输入http://localhost:8080/springmvc_mybatis/queryItems.action访问

查询成功

四 jar包及源码

链接:https://pan.baidu.com/s/16yTiEsCj8ejmh0gm8KHn8A
提取码:hegb

SSM整合的简单实现的更多相关文章

  1. SSM整合之---简单选课系统

    简单选课系统 一.实体图 二.功能 三.代码实现 1.SSM环境搭建 (1)pom.xml <dependencies> <dependency> <groupId> ...

  2. SpringMVC之简单的增删改查示例(SSM整合)

    本篇文章主要介绍了SpringMVC之简单的增删改查示例(SSM整合),这个例子是基于SpringMVC+Spring+Mybatis实现的.有兴趣的可以了解一下. 虽然已经在做关于SpringMVC ...

  3. ssm 整合 redis(简单教程)

    最后我建议大家使用 Spring StringRedisTemplate 配置,参阅: http://blog.csdn.net/hanjun0612/article/details/78131333 ...

  4. SSM整合配置

    SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis) 使用SSM(Spring.SpringMVC和Mybatis)已经有三个多月了,项目在技术上已经没有什么难点了,基于现有 ...

  5. 04.redis集群+SSM整合使用

    redis集群+SSM整合使用 首先是创建redis-cluster文件夹: 因为redis最少需要6个节点(三主三从),为了更好的理解,我这里创建了两台虚拟机(192.168.0.109 192.1 ...

  6. spring MVC框架入门(外加SSM整合)

    spring MVC框架 一.什么是sping MVC Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面.Spring 框架提供了构建 W ...

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

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

  8. SSM框架的简单搭建

    转:https://blog.csdn.net/zhshulin/article/details/37956105 Spring+SpringMVC+MyBatis spring       : 4. ...

  9. SSM整合文档

    SSM整合文档 v2 一. 文件说明 文件名 描述 spring-servlet.xml 配置SpringMvc框架相关 applicationContext.xml 配置Spring容器 sprin ...

随机推荐

  1. Fliptile (dfs+二进制压缩)

    Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He ha ...

  2. POJ - 1011 剪枝练习

    题意:给定n条拆掉的棍子,问能凑成最短的多条相同长度棍子的最短长度 x:当前第几条正在合成的棍子 y:目前正在尝试的拆掉的棍子 z:当前长度 剪枝方案: 1.按照长度单调性排序,减少重复搜索 2.如果 ...

  3. ndoejs创建多重文件夹

    function mkdir(filepath){ var path=require("path") if(!fs.existsSync(path.dirname(filepath ...

  4. 小问题总结:鼠标点击到输入框(input)里的时候,输入框的提示消失,鼠标再移开,输入框提示出现

    问题如标题: 鼠标点击到输入框(input)里的时候,输入框的提示消失,鼠标再移开,输入框提示出现.如图所示:   做法如下: <input type="text" name ...

  5. PIE SDK反距离权重插值算法

      1.算法功能简介 反距离权重 (IDW) 插值使用一组采样点的线性权重组合来确定像元值.权重是一种反距离函数.进行插值处理的表面应当是具有局部因变量的表面.此方法假定所映射的变量因受到与其采样位置 ...

  6. PIE SDK去相关拉伸

    1.算法功能简介 由于高度相关的数据集经常生成十分柔和的彩色图像,因此经常使用 去相关拉伸工具来体消除多光谱数据集中的高度相关性, 从而生成一幅色彩亮丽的彩色合成图像.去相关拉伸需要 3 个输入波段, ...

  7. MySQL 小抄

    1. 登录 mysql - u root -pEnter Password: 2. 查询端口 mysql> show global variables like "port" ...

  8. Transform 引起的 z-index "失效"

    重新学习CSS后的第三天,学习制作阴影的过程中,发现的问题:设置了box-shadow后展现的阴影: 添加transform:rotate(10deg);后的效果: 查看CodePen例子:阴影效果 ...

  9. oracle 基础知识(二)-表空间

    一,表空间 01,表空间? Oracle数据库是通过表空间来存储物理表的,一个数据库实例可以有N个表空间,一个表空间下可以有N张表.有了数据库,就可以创建表空间.表空间(tablespace)是数据库 ...

  10. SpringBoot 之 打war包

    1.修改打包方式为 war <packaging>war</packaging> 2. 修改tomcat 依赖 <dependency> <groupId&g ...