Index: lams_learning/web/error.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/error.jsp,v diff -u -r1.7 -r1.8 --- lams_learning/web/error.jsp 1 Jul 2006 12:49:10 -0000 1.7 +++ lams_learning/web/error.jsp 25 Jul 2006 06:01:51 -0000 1.8 @@ -1,58 +1,63 @@ -<%-- -Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) -License Information: http://lamsfoundation.org/licensing/lams/2.0/ +<%@ page language="java" isErrorPage="true" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> + + + - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. +<%-- Catch JSP Servlet Exception --%> +<% +if (exception != null) { +%> + + <%=exception.getMessage()%> + + + <%=exception.getClass().getName()%> + +<% + java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); + java.io.PrintStream os = new java.io.PrintStream(bos); + exception.printStackTrace(os); + String stack = new String(bos.toByteArray()); +%> + + <%=stack%> + +<% +} else if ((Exception) request.getAttribute("javax.servlet.error.exception") != null) { +%> - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - -<%@ taglib uri="tags-html" prefix="html" %> -<%@ taglib uri="tags-logic" prefix="logic" %> -<%@ taglib uri="tags-core" prefix="c" %> -<%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ page import="org.apache.struts.action.Action" %> + + <%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage()%> + + + <%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage() + .getClass().getName()%> + <% -String cprotocol = request.getProtocol(); -if(cprotocol.startsWith("HTTPS")){ - cprotocol = "https://"; -}else{ - cprotocol = "http://"; + java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); + java.io.PrintStream os = new java.io.PrintStream(bos); + ((Exception) request.getAttribute("javax.servlet.error.exception")).printStackTrace(os); + String stack = new String(bos.toByteArray()); +%> + + <%=stack%> + +<% } -String pathToShare = cprotocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/.."; %> +
+ + + +
+ \ No newline at end of file