Monday, July 12, 2010

將資料從1個servlet丟到另一個servlet

如果要將資料丟到別的程式,用到一個概念:
 所以 ,修改好的程式碼應該如下:
  request.setAttribute("error", error);
               RequestDispatcher view =
                request.getRequestDispatcher("tell_me_please.view");
        view.forward(request, response);


一定要在程式forward以前將資料setAttribute出去





No comments:

Post a Comment