现在的位置: 首页 > 综合 > 正文

jfinal post请求拦截类

2018年05月22日 ⁄ 综合 ⁄ 共 274字 ⁄ 字号 评论关闭

public void intercept(ActionInvocation ai) {
        // TODO Auto-generated method stub
        Controller controller = ai.getController();
        if ("GET".equalsIgnoreCase(controller.getRequest().getMethod()))
            ai.invoke();
        else
            controller.renderError(404, "使用post请求");
    }

抱歉!评论已关闭.