SpringMVC jsp界面值渲染不出来
使用springmvc开发过程中,jsp无法渲染出值。
Controller
@Controller
public class MvcController{
@GetMappin("/hello)
public String index(Model model) throws Exception {
model.addAttribute("msg", "SpringMVC");
return "hello";
}
}
JSP
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
hello,${msg}!
</body>
</html>
问题复现:

解决办法:
在jsp页面使用了el正则表达式,jsp需要配置
<%@page isELIgnored="false" %>

然后重启一下:


浙公网安备 33010602011771号