日期:2014-05-17  浏览次数:20898 次

问下关于RESTFUL的页面跳转
我现在rest到了

那之后怎么在里面跳转到INDEX.JSP呢?不使用任何框架的情况下怎么做呢?

------解决方案--------------------
HttpServletResponse response = new HttpServletResponse();
response.sendRedirect(location)

------解决方案--------------------
restful的返回值作为json格式返回,应该没有直接跳转的。你前台获取到返回的结果,根据结果再用js跳转
------解决方案--------------------
引用:
Quote: 引用:

HttpServletResponse response = new HttpServletResponse();
response.sendRedirect(location)

HttpServletResponse response = new HttpServletResponse();这个无法直接new的吧?
我只是举个例子,Servlet里面不需要new啊,参数里面有。或者ActionServletContext里面拿。