step2 : step 2 next step add void main in spring boot to starting point and controller class for rounting and views use of annotation :hello world in spring boot

 

give name ,select tick[] check box public static void main


write annotation using @ sign above class name
@SpringBootApplication

it will add imports and also it tells that class is of springbootapp



code

package helloApp;


import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;




@SpringBootApplication

public class mainx {


public static void main(String[] args) {

// TODO Auto-generated method stub

SpringApplication.run(mainx.class, args);

}


}




add class 
name homeController

code
in  controller class above type annotation   @RestController


and every routing function above type annotation
@RequestMapping("/")



code

package helloApp;

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

@RestController
public class homeController {
@RequestMapping("/")
public String  home()
{
return "hello home pagez";
}

@RequestMapping("/about")
public String about()
{
return "hello about";
}
}