cn.dreampie.common.web.render.JsonErrorRenderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfinal-dreampie Show documentation
Show all versions of jfinal-dreampie Show documentation
jfinal shiro-freemarker plugins
package cn.dreampie.common.web.render;
import cn.dreampie.common.web.thread.ThreadLocalUtil;
import com.jfinal.render.ErrorRender;
import com.jfinal.render.IErrorRenderFactory;
import com.jfinal.render.Render;
/**
* Created by wangrenhui on 14-4-28.
*/
public class JsonErrorRenderFactory implements IErrorRenderFactory {
public Render getRender(int errorCode, String view) {
if (ThreadLocalUtil.isJson())
return new JsonErrorRender(errorCode, view);
else
return new ErrorRender(errorCode, view);
}
}