1 40 package org.dspace.app.webui.servlet; 41 42 import java.io.IOException ; 43 44 import javax.servlet.ServletException ; 45 import javax.servlet.http.HttpServlet ; 46 import javax.servlet.http.HttpServletRequest ; 47 import javax.servlet.http.HttpServletResponse ; 48 49 import org.apache.log4j.Logger; 50 import org.dspace.app.webui.util.JSPManager; 51 import org.dspace.app.webui.util.UIUtil; 52 53 59 public class InternalErrorServlet extends HttpServlet 60 { 61 65 66 67 private static Logger log = Logger.getLogger(InternalErrorServlet.class); 68 69 protected void doGet(HttpServletRequest request, 70 HttpServletResponse response) throws ServletException , IOException 71 { 72 Throwable t = (Throwable ) request 74 .getAttribute("javax.servlet.error.exception"); 75 76 String logInfo = UIUtil.getRequestLogInfo(request); 77 78 String logMessage = ":session_id=" + request.getSession().getId() 81 + ":internal_error:" + logInfo; 82 83 log.warn(logMessage, t); 84 85 UIUtil.sendAlert(request, (Exception ) t); 87 88 JSPManager.showJSP(request, response, "/error/internal.jsp"); 89 } 90 91 protected void doPost(HttpServletRequest request, 92 HttpServletResponse response) throws ServletException , IOException 93 { 94 doGet(request, response); 95 } 96 } 97 | Popular Tags |