0
您好我是jsp(apache-tomcat)的新手,我正在做一個jsp項目中的小項目 期間捕獲異常我想重定向某些頁面在jsp和我worte這樣在服務器異常重定向到另一個頁面在jsp
try
{
//some code..
}
catch(Exception e)
{
System.out.println("error==>"+e);
response.sendRedirect("Servererror.html");
}
錯誤或異常時的代碼,我可以通過使用System.out.println() 看到錯誤但頁面沒有進行重定向
有沒有在我的代碼的任何問題,還是我做的什麼毛病......請幫助..
爲此,我可以使用throwable在catch catch – Kumar 2013-03-28 11:50:55
查看我更新的答案。 – 2013-03-28 11:55:22
非常感謝你 – Kumar 2013-03-28 11:57:46