@RequestMapping("/testString")
public String testString(Model model){
Stinfo stinfo = new Stinfo();
Date date =new Date(System.currentTimeMillis());
stinfo.setAihao("打篮球");
stinfo.setBanji("软件技术一班");
stinfo.setDate(date);
System.out.println(stinfo);
model.addAttribute("user",stinfo);
return "successOne";
}
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>Title</title>
</head>
<body>
成功!
${user}
</body>
</html>
解决方法:
在jsp页面的头部加入<%@ page isELIgnored=“false” %>