extension of ApplicationGateway

Thorsten Möller <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <011501c3878f$736c0d00$33d71e8d@Thoro>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.