Creating the View with a form

Java Server Pages is one of the view technologies supported by Spring Framework. Spring Framework makes it easy to create views with JSPs by providing a tag library. This includes tags for various form elements, binding, validation, setting themes and internationalizing messages. We will use the tags from the Spring MVC tag library as well as standard JSTL tag libraries to create our view in this example.

Let's start with creating the /WEB-INF/views/user.jsp file.

First, let's add the reference to the tag libraries to be used:

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>     <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>  <%@ taglib uri="http://www.springframework.org/tags/form" ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.