Repository navigation
Development Environement setup Spring MVC
AyushiDamele edited this page Dec 16, 2020
·
2 revisions
To read about spring mvc follow the guide : https://docs.spring.io/spring-framework/docs/current/reference/html/web.html
To setup Spring MVC project:
- In Eclipse -> Windows ->perspective -> open perspective -> Java EE.
- File -> New -> Dynamic Web Project -> project name("spring-mvc-demo") -> finish.
- Copy all the jar files that you have already downloaded for spring project inside the folder : project name -> WebContent->WEB-INF -> lib
- Copy 2 more dependencies inside lib folder : D:\Spring Hibernate Tutorials Slides and Source code\solution-code-spring-mvc-config-files\solution-code-spring-mvc-config-files\spring-mvc\starter-files\spring-mvc-demo\lib (copy the 2 files leaving the commons-logging file and paste in lib folder)
- Copy both the files from this folder and patse in WEB-INF folder: D:\Spring Hibernate Tutorials Slides and Source code\solution-code-spring-mvc-config-files\solution-code-spring-mvc-config-files\spring-mvc\starter-files\spring-mvc-demo\config
Select perspective as java EE New -> Maven project Keep location as default Add group id : as the beginning of our project package name Add Artifact id as your project name select archtype of webapp then finish A new maven project will be created which shows some errors Right click on project -> properties -> Targeted Runtime -> check the server checkbox (Apache Tomcat) in this case and "Apply and close" Now the errors will be removed Now to add the spring dependencies in your project go to file : src/main/webapp/WEB-INF/web.xml and add :