Create Your First Spring Starter Project From

By default you should be able to see the below UI in

Add the Dependencies

I am going to add the dependencies required to develop the REST API’s.

Extract this and import as maven project in STS/Eclipse

After the Extract

Right click on Project Explorer and click import

First time, it takes some time to pull all the maven dependencies

Right Click on the demo project Run As -> Maven build... and then type clean install

You should be able to see Build Success

Right click -> Run As -> Spring Boot Project

Spring Boot Maven Application is started successfully,

You should be able to see this then you spring boot application is running without any issues

Now, create with the below content,

package com.example.demo.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

public class SearchController {

	public List<String> getPopularSearchList() {
		List<String> popularSearchList = new ArrayList<>();
		popularSearchList.add("Formal Shirts");
		return popularSearchList;


Now hitting this url (http://localhost:8080/v1/search/popular) in chrome / postman gives the below response,

["Mobile","Laptop","Headset","Formal Shirts"]

Leave a Reply