Hi,
Hope you are all doing great. Let's learn together.
Join Telegram: 📲 https://t.me/contactajoydebnath
Chapters ❤
0:00 Introduction
00:24 Theory Discussion
06:22 What we will do today
13:13 Code Implementation
22:06 Read From Variable
Note:
Spring is a lightweight framework. It was developed by Rod Johnson in 2003. Spring framework makes the easy development of JavaEE applications.
Video Links:
Core Java Playlist:
• Core Java
Spring Playlist:
• Spring Framework
Spring Video List:
IOC, Dependency Injection, IOC Container, Coupling. • IOC,Dependency Injection,IOC Container,Cou...
IOC Container, BeanFactory, Important APIs, Lazy & Eager Loading. • IOC Container, BeanFactory, Lazy & Eager L...
Bean Scope, Singleton Scope, and Prototype Scope. • Bean Scope, Singleton Scope, and Prototype...
Autowiring, Autowiring Modes - byName, byType & constructor. • Autowiring, Autowiring Modes - byName, byT...
@Configuration, @Bean, @Component, @ComponentScan in Spring. • @Configuration, @Bean, @Component, @Compon...
What if we remove the @Configuration annotation in Spring? • What if we remove the @Configuration annot...
Spring JDBCTemplate, JDBC, Statement, and PreparedStatement • Spring JDBCTemplate, JDBC, Statement and P...
JDBCTemplate, RowMapper,ResultSetExtractor, BeanPropertyRowMapper Spring • JDBCTemplate, RowMapper,ResultSetExtractor...
Model-View-Controller(MVC), Spring MVC. • Model-View-Controller(MVC), Spring MVC. Sp...
Spring MVC with JSP (Java server Page). • Spring MVC with JSP (Java server Page). S...
Spring MVC with JSP (Java server Page). • Spring MVC with JSP (Java server Page). Sp...
Spring MVC Form Handling Example & RequestParam Annotation • Spring MVC Form Handling Example & Request...
How to Create Your First Model in Spring MVC? -- • How to Create Your First Model in Spring M...
Data Binding In Spring MVC Using DTO. -- • Data Binding In Spring MVC Using DTO. Spri...
Two-Way Data Binding in Spring MVC. -- • Two-Way Data Binding in Spring MVC. Spring...
Document Link -
https://docs.google.com/document/d/1a...
Databinding Using DTO
https://docs.google.com/document/d/1b...
Spring MVC
https://docs.google.com/document/d/16...
Like, Comment, Share, and Subscribe.
Thank you again.
Bootstrap
https://getbootstrap.com/docs/5.0/get...
https://getbootstrap.com/docs/5.0/for...
STS Link:
https://spring.io/tools
Eclipse Download
https://www.eclipse.org/downloads/pac...
Tomcat Download
https://tomcat.apache.org/download-90...
JDK Link:
https://www.oracle.com/java/technolog...
To download spring jars
https://repo.spring.io/ui/native/rele...
MySQL Connector JAR
https://mvnrepository.com/artifact/my...
MySQL Installer
https://dev.mysql.com/downloads/insta...
Data Binding In Spring MVC Using DTO
In Spring using the data binding concept, we can do the following two tasks
We can write to a variable
We can read from a variable
So in this article, We are going to cover the read-from-variable task.
We can implement read-from-variable using
taglib of spring form and 'modelattribute' and 'path' properties in html form.
And we can write-to-variable in the following two ways
Using @RequestParam Annotation
Using DTO (Data Transfer Object)
We have already used @RequestParam Annotation in Spring to capture or bind the data, but this is not an efficient approach. So we are going to use DTO (Data Transfer Object) to bind our data.
@RequestParam :
In Spring MVC, the @RequestParam annotation is used to read the form data and bind it automatically to the parameter present in the provided method. So, it ignores the requirement of the HttpServletRequest object to read the provided data.
How to Create Your First Model in Spring MVC?
Spring MVC is a Web MVC Framework for building web applications. The Spring MVC framework is comprised of the following components:
Model: A model can be an object or collection of objects that basically contains the application's data.
View: A view is used for displaying the information to the user in a specific format. Spring supports various technologies like jsp, freemarker, velocity, and thymeleaf.
Controller: It contains the logical part of the application. @Controller annotation is used to mark that class as controller.
Front Controller: It remains responsible for managing the flow of the web application. DispatcherServlet acts as a front controller in Spring MVC.
Note: Models are nothing, they are just data.
Model Interface
Spring Framework provides an Interface called Model to work with the data.
It is also used to transfer data between the view and controller of the Spring MVC application.