ahh i looked to quickly :) i though 1 does it more in the old way (AbortWithHttpStatusException) and the AbortWithWebErrorCodeException with a much cleaner way of doing (everything in a RequestTarget)
On Wed, May 7, 2008 at 9:45 AM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > and we have 2: > > AbortWithWebErrorCodeException > > Uses HttpServletResponse#sendError > > > AbortWithHttpStatusException > > Uses HttpServletResponse#setStatus > > > why 2? i dont know i think we need to clean up here.... (eelco? igor? > who > > was first ;) ) > > From HttpServletResponse#setStatus: > > * Sets the status code for this response. This method is used to > * set the return status code when there is no error (for example, > * for the status codes SC_OK or SC_MOVED_TEMPORARILY). If there > * is an error, and the caller wishes to invoke an error-page defined > * in the web application, the <code>sendError</code> method should be > used > * instead. > * <p> The container clears the buffer and sets the Location > header, preserving > * cookies and other headers. > > From HttpServletResponse#sendError: > > * Sends an error response to the client using the specified > * status. The server defaults to creating the > * response to look like an HTML-formatted server error page > * containing the specified message, setting the content type > * to "text/html", leaving cookies and other headers unmodified. > * > * If an error-page declaration has been made for the web application > * corresponding to the status code passed in, it will be served back > in > * preference to the suggested msg parameter. > * > * <p>If the response has already been committed, this method throws > * an IllegalStateException. > * After using this method, the response should be considered > * to be committed and should not be written to. > > Eelco > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
