jboot是一个基于jfinal、undertow开发的一个类似springboot的开源框架, 我们已经在正式的商业上线项目中使用。 jboot-1.0-alpha2更新如下: 修复:jbootrpcService 无法在类上进行注解的bug 以下是hello world: @UrlMapping(url = "/test")
public class ControllerTest extends JbootController {
public static void main(String[] args) {
Jboot.run(args);
}
@Inject
ServiceTest serviceTest ;
public void index() {
renderText("hello " + serviceInter.hello());
}
@Singleton
public static class ServiceTest{
public String hello() {
return "michael";
}
}
} 运行main方法后,访问http://127.0.0.1:8083/test 就能查看到效果了。 如果ServiceTest是一个远程服务,使用@JbootrpcService注解即可。 |