Professional Documents
Culture Documents
Spring - Part-3-27-Jan-2023
Spring - Part-3-27-Jan-2023
----------------
Spring MVC Module
-----------------
- Spring MVC Module is used to develop server side dynamic web applications
- MVC stands for Model View and Controller
- MVC Architecture is used to make the Model independent of View
Refer diagram MVC.png
@RequestMapping
---------------
used to map the result url
Ex:
<form action="login">
username ...
password ...
<input type="submit"/>
</form>
@Controller
public class LoginController
{
@RequestMapping("login")
public authenticate()
{
...
}
}
Click Next
Group Id : springmvc
Artifact Id : SpringMVCProj
Package : com.spring.mvc
click Finish
Note
----
If errors in the project,
Right click on SpringMVCProj -> Properties -> Targeted Runtimes ->
Make check mark to "Apache Tomcat Server v9" -> Click Apply and Close
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.10.RELEASE</version>
</dependency>
Note
----
The name of the spring bean xml configuration file should be "servlet-name-
servlet.xml"
where "servlet-name" is the servlet name given in <servlet-name> element of
web.xml file