Java框架

Gradle + IDEA 搭建一个 Spring + SpringMVC + Mybatis 的极速后台开发框架

被刻印的时光 ゝ 提交于 2019-12-03 04:28:46
一、创建项目 Create New Project -> Gradle -> Java & Web -> GroupId & ArtifactId -> Create sparete module per source set & Use local gradle distribution -> select “Gradle home” -> Next -> Finish 二、搭建项目结构 项目结构如下: 其中: config: 保存 Spring 的一些配置 controller: Controller dao: DAO model: Model service: Service utils: Servlet 配置 没有web.xml。 三、完善项目 四、各文件内容 SpringCoreConfig.java package com.haier.demo.config; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @ComponentScan({ "com.haier.demo.service" }) public class