我想在doPost()中跳转到另一个JSP页面,结果陷入死循环,HELP!!
就是这么一段代码:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
System.out.println("CruiseList Servlet got a request...");
ResponseMessage msg;
String command = request.getParameter("command");
HttpSession session = request.getSession();
System.out.println("command is: " + command);
if( command == null || command.equals(""))
{
System.out.println("Now the command is null, I want it redirect to Cruises.jsp");
try
{
session.setAttribute("custList", custList);
session.setAttribute("cruiseList", cruiseList);
System.out.println("Seesion setAttribute completed!");
}
catch (Exception e)
{
throw new ServletException(e);
}
response.sendRedirect("/ch4cruise/Cruises.jsp");
}