14.4 baseViewPath

  1. baseViewPath 设置由原来的configConstant(…) 方法中转移到了Routes 对象中,并且可以对不同的Routes对象分别设置,如下是示例:
  1. public class FrontRoutes extends Routes {
  2.  
  3. public void config() {
  4. setBaseViewPath("/_view");
  5.  
  6. add("/", IndexController.class, "/index");
  7. add("/project", ProjectController.class);
  8. }
  9. }
  1. configConstant(…)转移到configRoute(…)中的好处是可以分别对不同的Routes进行设置,不同模块的baseViewPath很可能不相同,从而可以减少冗余代码。上面的代码示例是用于Routes拆分后的情况,如果你的应用并没有对Routes进行拆分,只需要在configRoute 中如下配置即可:
  1. public void configRoute(Routes me) {
  2. me.setBaseViewPath("/_view");
  3.  
  4. me.add("/", IndexController.class);
  5. }

< 14.3 configEngine

14.5 RenderFactory >

原文: http://www.jfinal.com/doc/14-4