jersey spring 整合 怎么配置跳转jsp
1个回答
展开全部
很多种方法
@POST
@Path("add")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
// @FormParam表示通过HTML表单传入参数
public Viewable addStudent2(@FormParam("name") String name,
@FormParam("dept") String dept,
@Context HttpServletRequest request,
@Context HttpServletResponse response) {
// 保存name和dept的逻辑(略)
request.setAttribute("resultString", "success");
request.setAttribute("studentList", studentList);
HttpSession session = request.getSession();
session.setAttribute("user", "guohengj");
// 跳转到/strudent.jsp
return new Viewable("/itjob.jsp", null);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询