When it comes to Jboot, many people probably think of the Spring family of Springboot frameworks, but Jboot is not a Spring product. Jboot is a microservice framework based on JFinal and Undertow. It provides AOP, RPC, distributed cache, stream limiting, demotion, fusing, unified configuration center, Swagger API automatic generation, Opentracing data tracking, Metrics data monitoring, distributed session, code generator, Shiro security control and other functions. Support consul and other registries; Here’s a basic look at Jboot:
(1) The dependency of Jboot is relatively simple. In maven project’s PUM. XML, the following dependencies are introduced: IO
(2) Create Controller class:
import java.util.List; import com.jfinal.core.Controller; import com.jfinal.plugin.activerecord.Db; import io.jboot.web.controller.annotation.RequestMapping; @RequestMapping("/") public class IndexController extends Controller{ public void index() { renderText("hello,Jboot"); }}Copy the code
(3) Create a new startup class written as:
import io.jboot.app.JbootApplication; public class App { public static void main(String[] args) { Jboot.run(args); }}Copy the code
(4) After the startup, enter http://127.0.0.1:8080/ in the browser, you can see hello,Jboot;