package com.huangfude.common;

import com.jfinal.handler.Handler;

import javax.servlet.http.*;



public class BaseHandler extends Handler {

	@Override
	public void handle(String target, HttpServletRequest request,HttpServletResponse response, boolean[] isHandled) {

		//如果路径中包含admin(该路径下所有资源),那么验证身份,通过验证才能进入后台管理模块
		if(target.indexOf("admin")>0 && target.indexOf("admin/login")<0){
			HttpSession session = request.getSession(false);
			if(session==null||session.getAttribute("user")==null){
				//验证不成功，跳转到后台登陆页面
				target="/admin";
			}
		}
		nextHandler.handle(target, request, response, isHandled);
	}

}

@@ -377,16 +377,50 @@
 ogin%22)%3C0
+ && target.indexOf(%22admin/css%22)%3C0 
 )%7B%0A%09%09%09Ht

fix login