JFinal路由配置实例

如果需要下载demo项目、源码及详细文档请到: http://www.jfinal.com

JFinal QQ群:222478625

以下是JFinal正在开发的新项目的路由配置,欢迎批评指正:

/**
 * 网校网前台路由配置
 */
public class FrontRoutes extends Routes {
	
	public void config() {
		add("/common", CommonController.class);
		add("/login", LoginController.class, "/login_register");
		add("/logout", LogoutController.class, "/login_register");
		add("/register", RegisterController.class, "/login_register");
		add("/join_class_room", JoinClassRoomController.class, "/login_register");
		add("/help", HelpController.class);
		add("/about", AboutController.class);
		add("/deal", DealController.class);
		add("/search", SearchController.class);
		add("/school", SchoolController.class);
		小王();
		小杨();
	}
	
	private void 小王() {
		add("/", IndexController.class);
		add("/class", KlassController.class, "/klass");
		add("/user/class_room", ClassRoomController.class);
		add("/user/blog", BlogController.class);
		add("/user", UserController.class);
		add("/user/admin", AdminController.class);
		add("/user/friend", FriendController.class);
		add("/user/visit", VisitController.class);
	}
	
	private void 小杨() {
		add("/material", MaterialController.class, "/article/material");
		add("/news", NewsController.class, "/article/news");
		add("/mock", MockController.class, "/article/mock");
		add("/teacher", TeacherController.class, "/article/teacher");
		add("/user/favorite", FavoriteController.class);
		add("/user/message", MessageController.class);
		add("/user/fee_ticket", FeeTicketController.class);
		add("/user/credit_hour", CreditHourController.class);
		add("/user/bbs", BbsController.class);
		add("/sitemap", SitemapController.class);
		add("/tool_box", ToolBoxController.class);
	}
}

 如果需要下载demo项目、源码及详细文档请到: http://www.jfinal.com

JFinal QQ群:222478625

 

你可能感兴趣的:(route,jFinal,路由,Routes,路由配置)