0
안녕 페이지에 Spring MVC
을 쓰려고합니다.스프링 EL이 작동하지 않습니다.
Hello.jsp 라
<%@page isELIgnored="false"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>${hello.test()}</h1>
</body>
</html>
컨트롤러 수준 :
package Controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class Hello {
@RequestMapping(value="/test.htm")
public String test()
{
return "Hello";
}
}
하지만 호출되지 않습니다 test()
http://localhost:8080/WebApplication1/test.htm
방법을 요청할 때. 문제가 무엇입니까?
아니면 그냥 아무것도 또는 기대 값없이 본문 내용을 보여주지 :
지금 당신은 데이터를 읽을 수 있습니까? –
@JorgeCampos 아무런 증언도 없습니다. 빈 페이지가 있지만 _hello_가 될 것으로 예상됩니다. –
EL :'
$ {hello.test()}
나는 바로 뒤에있는이 줄을 Hello.jsp에 추가하십시오!'페이지를 테스트하여 결과를 확인하십시오. –