----------Controller-------
Package Com.test.mvc;
import Org.springframework.stereotype.Controller;
Import Org.springframework.ui.Model;
Import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class Generalcontroller {
@RequestMapping (value= "index.do")
Public String index_jsp (model model) {
Model.addattribute ("Test", "Hello!") ");
System.out.println ("index.jsp");
Return "index";
}
}
--------------index.jsp------------------
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%>
<%@ taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title>insert title here</title>
<body>
<cut value= "${test}" ></cut>
${test}
</body>
------------------result Output---------------------
${test} ${test}
-------------------Modify the content----------------------
index.jsp Add <%@ page iselignored= "false"%>
The results are displayed normally:
Hello, hello.
How does the JSP page in Spring MVC not get the data in the controller?