配置文件配置好 了之后可以进行第一个例子的编写了!
@Controller
@EnableAutoConfiguration()
public class SampleController
{
private Hello hello;
@Autowired
public SampleController(Hello hello)
{
this.hello = hello;
}
@RequestMapping("/")
@ResponseBody
String home(String type)
{
System.out.println("login:" + hello);
return "Hello World";
}
public static void main(String[] args) throws Exception
{
SpringApplication app = new SpringApplication(SampleController.class);
app.setWebEnvironment(true);
app.setShowBanner(false);
Set