2017年3月25日 星期六

【Spring Boot】Why using spring boot

When I need to produce restful api using spring framework,I use Spring MVC4
,that I need to config spring structure as below

We saw in project have some config file(xml),in spring xml config file was
common usage for spring developer,everything look like well.
But in spring boot ,we don’t need config file anymore,and we don’t need to
deploy web app to container.

Lets take a look what the spring boot project structure

Yes,no any config file,and no web.xml,amazing!

When we try to add to tomcat to test out project,ide can not let us add boot app to server

So how can we test out app?
Let's take a look on below file

DomoApplication.java

Lets run it as boot app

We can see this app running on 8080 port

Lets try it on browser,look like it running,but content a bit odd,actually we need to add something