public Routes add(String controllerKey, Class<? extends Controller> controllerClass, String viewPath) {
if (controllerKey == null)
throw new IllegalArgumentException("The controllerKey can not be null");
// if (controllerKey.indexOf(".") != -1)
// throw new IllegalArgumentException("The controllerKey can not contain dot character: \".\"");
controllerKey = controllerKey.trim();
if ("".equals(controllerKey))
throw new IllegalArgumentException("The controllerKey can not be blank");
if (controllerClass == null)
throw new IllegalArgumentException("The controllerClass can not be null");
if (!controllerKey.startsWith("/"))
controllerKey = "/" + controllerKey;
if (map.containsKey(controllerKey))
throw
源码有毒:Jfinal源码解析(二)
最新推荐文章于 2020-02-12 21:27:47 发布
本文深入剖析Jfinal的源码,从Controller的add方法开始,探讨Map集合的存储机制。接着关注jfinalConfig.configPlugin()中对项目插件的配置,分析Plugins类如何封装List的add方法,并着重讲解IPlugin接口。同时,文章还介绍了插件的启动过程,通过startPlugins()方法逐一启动。最后提到了全局拦截器的配置方法jfinalConfig.configInterceptor()。
摘要由CSDN通过智能技术生成