Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

global exception handling - struts sometimes ignores my setting in cfg

Status
Not open for further replies.

MarekCupak

Programmer
Aug 13, 2007
1
SK
i need to configure struts to display user a errpage.jsp, when runtime exception CustomException occur anywhere in the application. i've added to struts-config:

<global-exceptions>
<exception key="exception.Exception"
type="somepackage.CustomException"
path="/ErrorPage.jsp"/>
</global-exceptions>

and to web.xml:

<error-page>
<error-code>500</error-code>
<location>/ErrorPage.jsp</location>
</error-page>

when i browse page _spikeScriptletThrowingEx.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title></title>
</head>
<body>
<% throw new Exception(); %>
</body>
</html>

i receive only "The website cannot display the page, HTTP 500...". why is the ErrorPage.jsp not displayed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top