因为jsp页面放入到了WEB-INF中,需要通过后台跳转进行访问,但是发现jsp发送post请求后,后台跳转无效,虽然F12中的返回结果是正确的,但页面就是没有效果,无奈想到下面的笨方法,仅供参考
java----jsp发送请求到后台进行页面的跳转_回调函数
我这边前提是使用的jQuery的包

$.post("sa.action", $("#form").serialize(), function (result) {
            if (result.success) {
                window.location.href = "aa.action";
            }
        })

通过回调函数再次请求,因为我在回调函数中使用的是href进行提交的,所以这次后台的跳转页面是正常的了

        String vspecies = (String)getSession().getAttribute("Vspecies");
        System.out.println(vspecies);
        request.getRequestDispatcher("/WEB-INF/aa/"+vspecies).forward(request, response);
        getSession().removeAttribute("Vspecies");

各位的好方法还请赐教一下,不胜感激