Loading

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" %>

 然后重启一下:

posted @ 2022-01-22 16:00  Roc-xb  阅读(51)  评论(0)    收藏  举报

易微帮源码


易微帮官网