request请求转发之java
在项目中,有时候需要把数据直接显示到页面上,这可以使用request的请求转发
@RequestMapping(value="/xx")
public void info(HttpServletRequest request, HttpServletResponse response){
String url = "/xx/xx";
try{
request.getRequestDispatcher(url).forward(request, response);
} catch (ServletException | IOException e) {
throw new Exception(e);
}
}