错误
发生意外错误(类型=未找到,状态= 404)。
Controller:ApplicationController
@Controller
public class ApplicationController {
@ResponseBody
@RequestMapping("/home")
public String hello()
{
return "hello";
}
@RequestMapping("/welcome")
public String welcome()
{
return "welcomepage";
}
}
JSP:welcomepage.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>welcome</title>
</head>
<body>
<h2>welcome to jsp page</h2>
</body>
</html>
application.properties
spring.mvc.view.prefix=/WEB-INF/view/
spring.mvc.view.suffix=.jsp