how to create your first project in spring using eclipse

30
How to create your first project in Spring using eclipse Author : Rajorshi Mukherjee Abstract: This is just a brief walkthrough. NO explanations have been provided.

Upload: rajorshi-mukherjee

Post on 13-Apr-2017

73 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: How to create your first project in spring using eclipse

How to create your first project in Spring using eclipse

Author : Rajorshi Mukherjee

Abstract: This is just a brief walkthrough. NO explanations have been provided.

Page 2: How to create your first project in spring using eclipse

First Steps

• First download eclipse. (I used Mars as that is the latest version)

(http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/mars2)I recommend downloading JEE version as it can also be used for web app development.

• JDK 8+ is required to work with this.(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

• Download apache commons logging (using v 1.2)(https://commons.apache.org/proper/commons-logging/download_logging.cgi)

• Download Spring Framework Release (using 4.3.1)(https://repo.spring.io/release/org/springframework/spring/)

Page 3: How to create your first project in spring using eclipse

Change perspective to java and Create a new Java Project

Page 4: How to create your first project in spring using eclipse

Assign Name to project and click finish

Page 5: How to create your first project in spring using eclipse

Right click and goto build path->configure build path

Page 6: How to create your first project in spring using eclipse

Libraries-> Add External Jars

Page 7: How to create your first project in spring using eclipse

Add All Spring Files

Page 8: How to create your first project in spring using eclipse

Add Apache Commons Logging

Page 9: How to create your first project in spring using eclipse

All added jars will be shown

Page 10: How to create your first project in spring using eclipse

Added Jars can be found in Referenced Libraries

Page 11: How to create your first project in spring using eclipse

Create a new package in src folder

Page 12: How to create your first project in spring using eclipse

Give a name and click finish

Page 13: How to create your first project in spring using eclipse

Create a new inteface

Page 14: How to create your first project in spring using eclipse

Give a name and hit finish

Page 15: How to create your first project in spring using eclipse

Add 2 public methods to the interface

Page 16: How to create your first project in spring using eclipse

Create a new class inside the package

Page 17: How to create your first project in spring using eclipse

Give a name and hit finish

Page 18: How to create your first project in spring using eclipse

Add implements interface

Page 19: How to create your first project in spring using eclipse

Mouse hover at red warning and add unimplemented methods

Page 20: How to create your first project in spring using eclipse

Create default constructor and assign value to private String message and define the other two functions

Page 21: How to create your first project in spring using eclipse

Again create a new class

Page 22: How to create your first project in spring using eclipse

Give a name and hit finish

Page 23: How to create your first project in spring using eclipse

This class will contain main method and relevant business logic

Page 24: How to create your first project in spring using eclipse

Rt-Click src folder and goto new -> other

Page 25: How to create your first project in spring using eclipse

Search xml and select xml file -> hit next

Page 26: How to create your first project in spring using eclipse

Give a name to the file and hit finish

Page 27: How to create your first project in spring using eclipse

Add the mandatory beans header and create two beans inside it referencing two separate functions in the same implementation class

Page 28: How to create your first project in spring using eclipse

Finally Rt-Click Project and goto Run as Java App

Page 29: How to create your first project in spring using eclipse

You should see desired output in the bottom console

Page 30: How to create your first project in spring using eclipse

Thanks for your time

• Regards,• Rajorshi Mukherjee