暂时注释掉mapper的xml配置
创建数据库,注意数据的编码设置
package com.shenmazong.zg2.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author 军哥
* @version 1.0
* @description: 演示demo的controller
* @date 2023/10/14 17:02
*/
@Controller
@RequestMapping(value = "/index")
public class IndexController {
/***
* @description 测试接口
* @params
* @return java.lang.String
* @author 军哥
* @date 2023/10/14 17:48
*/
@GetMapping(value = "/hello")
@ResponseBody
public String hello() {
return "hello,world";
}
}
1)、点击 Add Configuration
2)、添加tomcat服务的配置
3)、添加部署
1)、spring.xml
2)、springmvc.xml