zoukankan      html  css  js  c++  java
  • springboot的使用

    为什么要使用springboot.

    参考: https://blog.csdn.net/xujianse/article/details/83141814

    说白了就是:

    方便快捷搭建web项目。

    不需要一堆的xml配置。只需要在yml或者property文件配置一些必要的变量

    内置tomcat,不需要打war包也能启动。

    无需配置的自动整合第三方的框架

    porfile: active 可以指定 dev, test, prod.

    springboot的注解

    1.@SpringBootApplication

    这是开启springBoot的启动注解,包含的注解相当与@EnableAutoConfiguration@SpringBootConfiguration@ComponentScan

    注解的使用在springboot里面很常见,

    结合mybatis的配置,只需要在配置文件里面加入mybatis的相关配置

    mybatis:
    # 搜索指定包别名
    typeAliasesPackage: com.jinqiyunlian.project.**.domain
    # 配置mapper的扫描,找到所有的mapper.xml映射文件
    mapperLocations: classpath*:mybatis/**/*Mapper.xml
    # 加载全局的配置文件
    configLocation: classpath:mybatis/mybatis-config.xml

    pom添加依赖:
    <dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>${mybatis.spring.boot.starter.version}</version>
    </dependency>
  • 相关阅读:
    呵呵
    数据类型转换方法
    工业设计三原则
    C#实现的根据年月日计算星期几的函数
    网页设计的12种颜色
    SqlParameter 存储过程
    HTTP 状态响应码
    Android获取屏幕高度和宽度
    Android屏幕自适应解决方案
    Nodejs学习笔记nodejs的安装
  • 原文地址:https://www.cnblogs.com/pro-wall-box/p/11192502.html
Copyright © 2011-2022 走看看