Hello,

I've been facing troubleshooting with declarative exception handling in
struts (tomcat 5.0, struts 1.1).

It does not work with :

web.xml : (no error page declaration)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; >
...
<web-app>



struts-config : (only one global exception)
....
<global-exceptions >
<exception
path="/WEB-INF/jsp/exception.jsp"
scope="request"
type="BaseException" />
</global-exceptions >
....


action:
protected ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {

int i = 0;
if(i == 0) {
throw(new BaseException());
}
...
}

result :

org.apache.jasper.JasperException: Impossible de compiler la classe pour la
JSP
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
19)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
74)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)



java.lang.ArrayIndexOutOfBoundsException: 567
org.apache.jasper.compiler.JspReader.peekChar(JspReader.java:156)
org.apache.jasper.compiler.JspReader.isSpace(JspReader.java:349)
org.apache.jasper.compiler.JspReader.isDelimiter(JspReader.java:432)
org.apache.jasper.compiler.JspReader.parseToken(JspReader.java:397)
org.apache.jasper.compiler.Parser.checkUnbalancedEndTag(Parser.java:1699)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1561)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:22
0)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:461)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
11)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
74)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

no

Could anybody please help ?

thank you very much.

[EMAIL PROTECTED]

-----Message d'origine-----
De : Keith Bottner [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 24 août 2004 00:51
À : Struts Users Mailing List
Objet : global-exceptions aren't working?

I cannot get the configuration of my global-exception to pick up any errors.
If an error occurs I just get the blank white page. Here is my
global-exception configuration section.


<global-exceptions>
    <exception key="exception.application" path="errors"
type="java.lang.Exception" /> </global-exceptions>

Then I have a global-forward that looks like this

<forward name="errors" path="/errors.do" />

I tried specifying /errors.do as the path for the global-exception and that
did not work either. Any ideas on why Exceptions are not getting routed?

Thanks,

Keith


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to