Spring MVC- 101; A simple project for simple Spring MVC Web Application.
Here we present a simple project for understanding Spring MVC Web Application, with presentation of MVC concept. Here we have shown features like,
- Model-View-Controller project structure. Where we have a Model named- Student, Controller Packages, and Views under WebContent
- We have used Jsp as View content for WEB pages
- We have also shown how to use external resource files like, .properties files to access data rather hard coded value
- Open Eclipse IDE installed in your system and create a "Dynamic Web Project".
- Once created copy "src" & "WebContent" folder into the Project create.
- Need to add Lib jar into classpath, those Jar files are provided under following folder: "WebContent/WEB-INF/lib".
- Now right click on project root in Eclipse, and go to properties.
- Select "Java Build Path" and the select tab "Libraries"
- Click on "Add JARs..." button and got to project based "lib" folder and select the all the jar files and add., 'Apply and Close'
- Run the project
All the application are available under package named: Controller --> "com.anir.mvc.controller" Model --> "com.anir.mvc.model" Views --> "/spring-mvc-demo/WebContent/WEB-INF/view/"
As this a Web Application. This Application need to be run on Tomcat Server. Deploy the project into Tomcat Server to run. Once deployed open the following link into browser: http://localhost:8080/spring-mvc-demo/ ; This is the Landing page with linked to other features.
Anirban Maiti: