JSTL Maven Dependency:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>Controller
@Controller
@RequestMapping("/")
public class HelloController {
@RequestMapping(value = "out",method = RequestMethod.GET)
public String printWelcome(ModelMap model) {
model.addAttribute("message", "Hello JSTL!");
return "out";
}
}out.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<c:out value="${message}" />
</body>
</html>OUTPUT:
Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
