Tuesday, February 20, 2024 11:00 AM
In today's session we will start our next module Spring MVC
---------------------------------------------------------
what is Spring MVC ?
- MVC Stands for model view and controller
- model : in java object structure or pojo class known as model
- view : view is nothing html or jsp pages in MVC project
- Controller : controller is java classes which manages HTTP request and Responses
---------------------------------------------------------------------------------
where we use MVC module ?
- Sping MVC is use to create Webapplication's
- Webapplication can be access from everywere through network.
- Webapplication required servers to run the application.
--------------------------------------------------------------------------------
what is webapplication ?
- the aaplication which running on server and can be acces every where globaly known as
webapplication.
- webaaplication is the combination of client side app and server side app.
--------------------------------------------------------------------------------------
Steps to install and configure apache tomcat server
-------------------------------------------------------------------
- download apache tomcat server .exe file 8.0 and above version
link : [Link]
- install apache tomcat server in your computer
- configure apache server to STS ide
--------------------------------------------------------------------
Steps to create Spring MVC Project.
-- create maven project
- right click project explorer -> new -> maven project -> next -> select archytype webapp
-> grouppID (package name) -> Artifact Id (project name).
-- configure apache server to project
- rigth click project -> properties -> targetd runtime -> check apache server -> apply and close
-- create java folder is src/main path through system
-- add maven dependency of spring webmvc in [Link] file
<!-- [Link] -->
<dependency>
<groupId>[Link]</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.30</version>
</dependency>
-- declare DispatcherServlet in [Link]
<web-app>
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>[Link]</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
-- declare [Link]
<beans>
<context:component-scan base-package="[Link]"/>
</beans>
-----------------------------------------------------------------------------------------------------