Spring Form Tag Library
Spring Form Tag Library
• It is a collection of JSP tags that simplify the process of creating HTML forms with Spring
MVC
Traditional Way
Here we will be getting the values from the form using HttpServletRequest and
then creating the student obj and setting all those values and then adding it to
the model and we can retrive these values in first.jsp like this
<h2>${stdObj.getName()}</h2>
But if we have many text fields in the form it would be very difficult to get all
those values and then create a object and again set all those values into that
object
□ So we can use Spring form Tag Library to solve this issue
• NOTE :
○ The Spring Form Tag Library is a powerful tool that can help us to develop web
applications more quickly and easily. It is a standard part of the Spring MVC
Framework and used by many developers
○ To use Spring Form Tag Library we have to add one dependency i.e. spring-security-
taglibs
Folder Structure
Since in form page we are Going get
Student details here we need to create
Student Obj and add it to model
○ Rather than using the left side part we can use right side part
Both do the same task
a. Method-Level Annotation