Chuck,
I just did that, and I understood what it was trying to do:
I do have 'path' attribute declared for my exception, and it start
with "/" like this:
path="/errors/foo.jsp"
And in the RequestProcessor.processActionForward(...)
.................
} else {
if (path.startsWith("/") && !forward.getContextRelative()) {
*1 --> path = appConfig.getPrefix() + path;
}
doForward( path, request, response);
}
} // proteced void processActionForward(...)
*1 is where it altered my 'path'. And when doForward(...) get calls,
path(uri) yeild null RequestDispatcher, which result
HttpServletResponse.SC_INTERNAL_SERVER_ERROR.
protected void doForward(String uri, HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
RequestDispatcher rd =
getServletContext().getRequestDispatcher(uri);
if (rd == null) {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
getInternal().getMessage
("requestDispatcher", uri));
return;
}
rd.forward(request, response);
}
What is the right way to fix this?
Thanks,
Danny
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 11:19 AM
To: Struts Users Mailing List
Subject: Re: Declarative Exception handling using the Tiles RequestProcesso
an d the SubApp feature of Struts1.1
Danny,
A couple things: First, the path attribute should
begin with a "/". When the ExceptionHandler has its
execute() method called, if the path is specified, it
creates an ActionForward on the fly using the path
attribute that you specify. Otherwise, the input
attribute is used from the action mapping. Take a look
at the JavaDoc for the "path" property in the
org.apache.struts.config.ForwardConfig class and see if
that helps to some sense of what's going on.
Chuck
> Chuck,
>
> What is your take on this? When I throw and Exception within and
> Action, Struts found my declared Exception alright. But it doesn't
> seems to find the path to the resource I declared. This happens in my
> SubApp, and I was using the Tiles Controller. Noticed, the path I
> defined for the Exception wasn't a Tiles Definition, it is relative to
> the Application Context. And also, in your books where you specify
> the DTD's ELEMENT for 'exception', you weren't mention anything about
> how it should behave with SubApp. I see no attribute like
> contextRelative for the Forward elements.
>
> Thanks,
>
> danny
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>