/** * Returns the property value as {@link Boolean} type. */ default boolean getBooleanProperty(String name) { return getBooleanProperty(name, false); }
public boolean isDev() { return config.getBooleanProperty(PROP_DEV); }
@Bean public static WebMvcRegistrations webMvcRegistrations() { AppConfig config = leap.spring.boot.Global.config(); if(null != config && config.getBooleanProperty("jmms.spring.validate")) { LeapOperationSupport.RequestMappingHandlerAdapterEx.enabled = true; final RequestMappingHandlerAdapter adapter = new LeapOperationSupport.RequestMappingHandlerAdapterEx(); return new WebMvcRegistrationsAdapter(){ @Override public RequestMappingHandlerAdapter getRequestMappingHandlerAdapter() { return adapter; } }; }else { return null; } }
@Override public void preAppStart(App app) throws Throwable { if (app.config().getBooleanProperty(Config.PROP_START, true)) { Engine engine = app.factory().getBean(Engine.class); engine.start(); } }
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { if(!config.getBooleanProperty("db.console", false)) { resp.sendError(HttpServletResponse.SC_BAD_REQUEST,"db console is disabled"); return;