com.jfinal.config.Constants Java Examples

The following examples show how to use com.jfinal.config.Constants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DemoConfig.java    From sqlhelper with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * 配置常量
 */
public void configConstant(Constants me) {
	loadConfig();
	
	me.setDevMode(p.getBoolean("devMode", false));
	
	/**
	 * 支持 Controller、Interceptor、Validator 之中使用 @Inject 注入业务层,并且自动实现 AOP
	 * 注入动作支持任意深度并自动处理循环注入
	 */
	me.setInjectDependency(true);
	
	// 配置对超类中的属性进行注入
	me.setInjectSuperClass(true);
}
 
Example #2
Source File: JfinalConfigListener.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public void onJfinalConstantConfig(Constants constants) {
    constants.setError401View("/template/401.html");
    constants.setError403View("/template/403.html");
    constants.setError404View("/template/404.html");
    constants.setError500View("/template/500.html");
    constants.setRenderFactory(new AppRenderFactory());
}
 
Example #3
Source File: JfinalConfigListener.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public void onJfinalConstantConfig(Constants constants) {
    constants.setError401View("/template/401.html");
    constants.setError403View("/template/403.html");
    constants.setError404View("/template/404.html");
    constants.setError500View("/template/500.html");
    constants.setRenderFactory(new AppRenderFactory());
}
 
Example #4
Source File: JfinalConfigListener.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public void onJfinalConstantConfig(Constants constants) {
    constants.setError401View("/template/401.html");
    constants.setError403View("/template/403.html");
    constants.setError404View("/template/404.html");
    constants.setError500View("/template/500.html");
    constants.setRenderFactory(new AppRenderFactory());
}
 
Example #5
Source File: JFinalConfigExt.java    From jfinal-ext3 with Apache License 2.0 5 votes vote down vote up
/**
 * Config constant
 * 
 * Default <br/>
 * ViewType: JSP <br/>
 * Encoding: UTF-8 <br/>
 * ErrorPages: <br/>
 * 404 : /WEB-INF/errorpages/404.jsp <br/>
 * 500 : /WEB-INF/errorpages/500.jsp <br/>
 * 403 : /WEB-INF/errorpages/403.jsp <br/>
 * UploadedFileSaveDirectory : cfg basedir + appName <br/>
 */
public void configConstant(Constants me) {
	//load properties
	this.loadPropertyFile();
	me.setViewType(ViewType.JSP);
	me.setDevMode(this.getAppDevMode());
	me.setEncoding(Const.DEFAULT_ENCODING);
	me.setError404View(PageViewKit.get404PageView());
	me.setError500View(PageViewKit.get500PageView());
	me.setError403View(PageViewKit.get403PageView());
	JFinalConfigExt.APP_NAME = this.getAppName();
	// config others
	configMoreConstants(me);
}
 
Example #6
Source File: JbootAppListenerManager.java    From jboot with Apache License 2.0 5 votes vote down vote up
@Override
public void onConstantConfig(Constants constants) {
    for (JbootAppListener listener : listeners) {
        try {
            listener.onConstantConfig(constants);
        } catch (Throwable ex) {
            log.error(ex.toString(), ex);
        }
    }
}
 
Example #7
Source File: JPressCoreInitializer.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onConstantConfig(Constants constants) {

    constants.setRenderFactory(new JPressRenderFactory());
    constants.setCaptchaCache(new JPressCaptchaCache());
    constants.setJsonFactory(() -> new JPressJson());

}
 
Example #8
Source File: WeixinConfig.java    From jfinal-weixin with Apache License 2.0 5 votes vote down vote up
public void configConstant(Constants me) {
	loadProp("a_little_config_pro.txt", "a_little_config.txt");
	me.setDevMode(PropKit.getBoolean("devMode", false));
	
	// ApiConfigKit 设为开发模式可以在开发阶段输出请求交互的 xml 与 json 数据
	ApiConfigKit.setDevMode(me.getDevMode());
}
 
Example #9
Source File: JFinalKit.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
public static Constants getConstants() {
    return JFinalKit.constants;
}
 
Example #10
Source File: XlsConfig.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
@Override
public void configConstant(Constants me) {
    me.setEncoding("utf-8");
    me.setDevMode(true);
}
 
Example #11
Source File: TestAppListener.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public void onConstantConfig(Constants constants) {
    System.out.println("TestAppListener.onConstantConfig");
}
 
Example #12
Source File: JFinalConfigExt.java    From jfinal-ext3 with Apache License 2.0 2 votes vote down vote up
/**
 * Config other More constant
 */
public abstract void configMoreConstants(Constants me);
 
Example #13
Source File: StandaloneAppConfig.java    From jfinal-ext3 with Apache License 2.0 2 votes vote down vote up
@Override
public void configMoreConstants(Constants me) {
	
}
 
Example #14
Source File: TestConfig.java    From jfinal-ext3 with Apache License 2.0 2 votes vote down vote up
@Override
public void configMoreConstants(Constants me) {
	
}
 
Example #15
Source File: ApiConfigPropDemo.java    From jfinal-ext3 with Apache License 2.0 2 votes vote down vote up
@Override
public void configMoreConstants(Constants me) {
	
}
 
Example #16
Source File: JbootAppListener.java    From jboot with Apache License 2.0 votes vote down vote up
public void onConstantConfig(Constants constants);