概述
配置文件中的内容
#server server.port=8888 ######################################################## ### u6570u636Eu6E90 ######################################################## spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/excel spring.datasource.username=root spring.datasource.password=root spring.datasource.initialSize=1 spring.datasource.minIdle=1 spring.datasource.maxActive=20 ######################################################## ### MYBATIS ######################################################## mybatis-plus.mapper-locations=classpath:mapper/**Mapper.xml mybatis-plus.typeAliasesPackage=com/qmx/model #u4E3Bu952Eu7C7Bu578B 0:"u6570u636Eu5E93IDu81EAu589E", 1:"u7528u6237u8F93u5165ID",2:"u5168u5C40u552Fu4E00ID (u6570u5B57u7C7Bu578Bu552Fu4E00ID)", 3:"u5168u5C40u552Fu4E00ID UUID"; mybatis-plus.global-config.id-type=2 #u5B57u6BB5u7B56u7565 0:"u5FFDu7565u5224u65AD",1:"u975E NULL u5224u65AD"),2:"u975Eu7A7Au5224u65AD" mybatis-plus.global-config.field-strategy=2 #u9A7Cu5CF0u4E0Bu5212u7EBFu8F6Cu6362 mybatis-plus.global-config.db-column-underline=true #u5237u65B0mapper u8C03u8BD5u795Eu5668 mybatis-plus.global-config.refresh-mapper=true ######################################################## ### FREEMARKER ######################################################## spring.freemarker.allow-request-override=false spring.freemarker.cache=true spring.freemarker.check-template-location=true spring.freemarker.charset=UTF-8 spring.freemarker.content-type=text/html spring.freemarker.expose-request-attributes=false spring.freemarker.expose-session-attributes=false spring.freemarker.expose-spring-macro-helpers=false spring.freemarker.request-context-attribute=request spring.freemarker.suffix=.ftl spring.freemarker.template-loader-path=classpath:/templates/ spring.freemarker.freemarker-variables.base=#{servletContext.contextPath}
以下是一基于springboot搭建的freemaker+mybatis 使用的是阿里的数据连接池,放到pom文件里面下载依赖即可使用
<!--spring-boot start--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!--spring-boot End--> <!-- freemarker --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency> <!--freemarker End--> <!-- mybatis-plus begin --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatisplus-spring-boot-starter</artifactId> <version>${mybatisplus-spring-boot-starter.version}</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus</artifactId> <version>${mybatisplus.version}</version> </dependency> <!-- mybatis-plus end --> <!--alibaba--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.29</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> <!--alibaba End--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency>然后一个添加一个启动类即可
最后
以上就是健康裙子为你收集整理的springboot 整合freemaker+mybatis的全部内容,希望文章能够帮你解决springboot 整合freemaker+mybatis所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复