extension of ApplicationGateway
Thorsten Möller <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <01dc01c38c49$48cc0fa0$33d71e8d@Thoro> |
I posted this a few days ago but I believe it got lost in somewhere. My
apologies if this is a repost for some (or all) of you.
------------------------
Is it possible to extend the Application Gateway to send an 404 error in
situations when the gateway can't map the request to an event. At the moment
an HttpRequestEvent is dispatched by default. Maybe it is useful to specify
this in event-gateway.xml or web.xml by additional parameter(s).
code snip from ApplicationGateway, to demonstrate what I mean:
...
} catch (Exception e) {
//if we can't map the request to an event, we will just
//send a 404 error or dispatch a generic HttpRequestEvent
//according to configuration
boolean send404 = getItFromSomewhere();
if (send404)
{
resp.sendError(HttpServletResponse.SC_NOT_FOUND);
}
else
{
logger.error("Class "+eventName+" not found...Creating a generic
HttpRequestEvent");
event = new HttpRequestEvent();
}
}
...
Thorsten