Spring MVC Project: Setup

Software Requirements

  • Eclipse Mars 2
  • Java, jdk 1.6 and above
  • Spring 4 jar files(download)
  • Apache Tomcat 7

Step 1: Create a Dynamic Web Project(File>New>Dynamic Web Project)

Step 2: Create project folder and packages as shown below

Step 3: Add required Spring MVC libs

Step 4: Add following code in web.xml

Step 5: Add following code in servlet-context.xml

Step 6: Add following code in application-context.xml

Step 7: Add following code in TheContrller.java

Step 8: Add following code in 2 jsp files- hello.jsp and link.jsp 

Step 9: Start the tomcat server

Step 10: Open the browser and open http://localhost:8080/SpringMvcBySarthak/hello

GitHub of the project here

Advertisements

One thought on “Spring MVC Project: Setup

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s