标签:ons view ret ring public new free tco conf
1 public class MyErrorRenderFactory implements IErrorRenderFactory{ 2 3 public Render getRender(int errorCode, String view) { 4 return new MyErrorRender(errorCode, view); 5 } 6 class MyErrorRender extends ErrorRender { 7 public MyErrorRender(int errorCode, String view) { 8 super(errorCode, view); 9 } 10 public void render() { 11 //这个里面是可以在域中设置一些值的 12 // request.setAttribute("csspath", "../"); 13 setView("/error/404.html"); 14 super.render(); 15 16 // RenderFactory.me().getFreeMarkerRender(view).setContext(request, response).render(); 17 } 18 } 19 }
//然后 public void configConstant(Constants me) { me.setErrorRenderFactory(new MyErrorRenderFactory()); }
标签:ons view ret ring public new free tco conf
原文地址:http://www.cnblogs.com/niuzhifa/p/6227515.html