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. Only in this way, we can improve us.
Yes
No
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *