Java spring project part 1

Quality assurance, Devs and SEO teams ready to help your business grow

Java spring project part 1

Project: Create a Circle and a Point class. One will depend on the other. Circle will have a Point as the circle’s center.

Use the Constructor to create an injection.

Create a new Maven Project. Add the Spring dependency. Define in the xml configuration file a Point and Circle class instances.


For Point instance use value to add the dependencies for x and y fields.

For the Circle instance use both value and ref to add dependencies to the circle’s ray and Point bean.

Go to pom.xml file and add the dependecies:


Inside <project> tag add a new dependency.



<groupId>org.springframework </groupId>

<artifactId>spring-context </artifactId>

<version>4.3.0.RELEASE </version>



Go to Project main menu, right click, Select Build with Dependencies


In order to use an xml config file, we will make use of the following class instance after creating a Main class in Source Packages to make an explicit configuration in XML:

FileSystemXmlApplicationContext context;

context = new FileSystemXmlApplicationContext();


No Comments

Add your comment