要求:创建基于Maven的SpringBoot项目;创建基于Thymeleaf的HTML模板文件,作为程序主页;创建Controller类,响应客户端请求;添加显示和删除学生信息的功能;
SpringMVC以Contrller响应客户端的请求; SpringMVC以Thymeleaf添代了JSP;删除一个学生:取得学生的sid,服务端跟据sid来构建删除SQL语句。
具体的操作步骤及每个步骤后的显示图是怎样的?
student,包含字段id,name,age,address。
package com.spring.mvc.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author ZhuYouBin
* @version 1.0.0
* @Date: 2022/9/3 20:42
* @Description
*/
@Controller
@RequestMapping("/thymeleaf")
public class ThymeleafController {
@RequestMapping("/index")
public String index() {
// 返回具体的 index.html 页面
// SpringMVC 框架会进行拼接: /WEB-INF/pages/ index .html
return "index";
}
}
非常抱歉,由于缺乏具体的问题描述,我无法给出相关操作步骤和图示。请您提供更加具体的问题和需求,以便我能够提供更准确的解决方案。谢谢!
我这有个案例
你运行截图就行了,学生信息有哪些字段