Reputation: 31
I just started to learn jsp
and spring
. I deleted formattedDate
(as a default
) in HomeController.java
and changed to model.addAttribute("answer", "yes")
and on web, it only shows . and i don't understand why.
I tried to put definition like String answer = "yes"
but it didnt work.
this is HoneController.java:
@Controller
public class HomeController {
@RequestMapping("/main")
public String home(Locale locale, Model model) {
model.addAttribute("answer", "yes");
return "home";
}
}
and here is home.jsp:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" pageEncoding="UTF-8" %>
<html>
<head>
<title>Home Page</title>
</head>
<body>
<h1>
hello
</h1>
<P> Is it happening? : ${answer}. </P>
</body>
</html>
Upvotes: 0
Views: 55