java - Ultimate Aim of Spring-Boot -


as may know spring4 comes new features, , 1 of important feature among them spring-boot. following links below

http://docs.spring.io/spring-boot/docs/current-snapshot/reference/htmlsingle/#boot-documentation

https://github.com/spring-projects/spring-boot

spring-boot feature comes new class files in org.springframework.boot.* start spring application. there 2 question comes in mind that

1- javase, can start-up spring application previoues spring versions easly, new feature spring-boot simple boot

2- javaee, far know spring-boot not javase project, can start-up web projects well. in future spring-boot works application-server (like glassfish)

although spring boot works spring 4+, technically different project. means can use spring 4 without spring boot code.

the aim of spring boot provide easy way configure spring application providing sensible defaults , easy configuration options stuff commonly used (and otherwise have implemented) on , on again in our applications.

as far starting java se application, spring boot start application other java se, main method, , looks this:

@configuration @enableautoconfiguration //whatever other annotations public class application {      public static void main(string[] args) {         springapplication.run(application.class, args);          //do whatever     }  } 

in order use web environment, spring boot uses embedded servlet container (tomcat default, jetty available). means code like:

@componentscan @enableautoconfiguration public class application {      public static void main(string[] args) {         springapplication.run(application.class, args);     } }  @restcontroller public class hellocontroller {      @requestmapping("/")     public string index() {         return "greetings spring boot!";     }  } 

is enough started (providing required dependencies on classpath).

seeing working spring code light, breath of fresh air! no longer need loads of xml or java config files, defaults work great! can start , stop whole application main method inside ide! sweet!


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -