在登录拦截器里面跳转到指定jsp页面

是这样的。詹总。

写了一个登录拦截器,未登录的用户就跳转到登录页面,页面都是ajax请求。

可是页面没有跳转,f12查看了下返回的response确定是登录页面的jsp内容。

我后台是这样的:

if( null ==  controller.getSession().getAttribute("UID") ){

//表示没登录 跳转到登录页面

controller.render("/jsp/user/login.jsp");

// controller.forwardAction("com.wozi.base.BaseController");

}else{

inv.invoke();

}

尝试反射生成baseController,里面index再调用renderjsp。可是这样也行不通。发现封装的属性全部为空,我这样粗暴是不行的。请问有什么办法吗?

评论区

Irin.Chan

2017-04-14 19:47

ajax 返回 jsp内容没毛病。之前不会用freemarker就是这样搞代码生成的。

linuxea

2017-04-14 19:56

@Irin.Chan 那现在应该怎么办啦??

热门反馈

扫码入社