Java源码示例:com.jfinal.config.Constants
示例1
/**
* 配置常量
*/
public void configConstant(Constants me) {
loadConfig();
me.setDevMode(p.getBoolean("devMode", false));
/**
* 支持 Controller、Interceptor、Validator 之中使用 @Inject 注入业务层,并且自动实现 AOP
* 注入动作支持任意深度并自动处理循环注入
*/
me.setInjectDependency(true);
// 配置对超类中的属性进行注入
me.setInjectSuperClass(true);
}
示例2
@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());
}
示例3
@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());
}
示例4
@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());
}
示例5
/**
* 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);
}
示例6
@Override
public void onConstantConfig(Constants constants) {
for (JbootAppListener listener : listeners) {
try {
listener.onConstantConfig(constants);
} catch (Throwable ex) {
log.error(ex.toString(), ex);
}
}
}
示例7
@Override
public void onConstantConfig(Constants constants) {
constants.setRenderFactory(new JPressRenderFactory());
constants.setCaptchaCache(new JPressCaptchaCache());
constants.setJsonFactory(() -> new JPressJson());
}
示例8
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());
}
示例9
public static Constants getConstants() {
return JFinalKit.constants;
}
示例10
@Override
public void configConstant(Constants me) {
me.setEncoding("utf-8");
me.setDevMode(true);
}
示例11
@Override
public void onConstantConfig(Constants constants) {
System.out.println("TestAppListener.onConstantConfig");
}
示例12
/**
* Config other More constant
*/
public abstract void configMoreConstants(Constants me);
示例13
@Override
public void configMoreConstants(Constants me) {
}
示例14
@Override
public void configMoreConstants(Constants me) {
}
示例15
@Override
public void configMoreConstants(Constants me) {
}
示例16
public void onConstantConfig(Constants constants);