JFinal项目中获取根目录

config类中定义方法:

@Override
public void configHandler(Handlers me) {
me.add(new ContextPathHandler("base_path"));
}

然后在页面head标签中中添加:

<base href="${base_path}/" />

这样项目中的资源文件引用就不会出问题了

posted @ 2014-01-28 09:57  狂热的猴子  阅读(771)  评论(0)    收藏  举报