org.springframework.boot spring-boot-starter-thymeleaf
success.html
Title 哈 去百度 去百度1
@Controller public class viewController { @GetMapping("/atguigu") public String atguigu(Model model){ model.addAttribute("msg","你好 guigu"); model.addAttribute("link","http://www.baidu.com"); return "success"; } }
Title 哈 去百度 去百度1
增加以下代码
@GetMapping("/s") public String s(Model model){ return "s"; }
s.html
Title uigvuiwygbwiuvwhiugbvrioubuwibhgvpu3igvbiu
点击去百度1,跳转到s.html页面
application.properties添加这段
server.servlet.context-path=/world
%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>Insert title here
@GetMapping("/cll.jsp") public String dfg(){ return "s"; }
仍然显示s.html内容
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)