Spring MVC Setup Using Dynamic Project in Eclipse
Spring MVC Setup Using Dynamic Project in Eclipse
Steps :-
1) Create a Dynamic Web Project Using Eclipse and setp Spring boot . Learn more about Spring boot here
Then New Project Dialog Box Appears :-
Enter the details as shown , if Target Runtime is not configured , please configure by clicking on New Runtime and follow steps , Now click on finish.
Eclipse Project Explorer Looks like this Now .
Create a WEB.xml as we have not added web.xml earlier (There is a checkbox to generate web.xml automatically in eclipse New Project Tabs ),
Create a web.xml inside WEB-INF folder , by RightClick->New ->other->XML->and give file name as web.xml
Contents of web.xml is as below:-
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>SprintInstall</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
Create a index,jsp under WEB-INF folder same way we created XML earlier but chose jsp instead XML
Step 2:-
Download all the spring jars from here Click Here To Download
Step 3 :-Create user Library in Eclipse ,
Right Click On Project ->Properties ->Java Build Path->Libraries and Click On Add Library then follow Screenshot Below .
Now Click On Next , on the Add Library Window that comes Out .
Must Read :-
No comments: