Just my two cents:

Use HttpServletRequest:sendError rather than redirecting to a special
page, and have your webserver configuration redirect the user to a
pretty page if that's necessary.

Rationale:
In every website that I've put up, someone somewhere has eventually
wanted to see a count of the number of the various errors that our
webserver has served up (usually at least the counts for 404 and 500.)

If you magically redirect to a new page in the action, it can be really
hard to track how many times that occurs.  It's much cleaner to have
them actually appear in the logs.

-Peter

On Wed, 2002-10-02 at 15:07, Adam Sherman wrote:
> David Graham wrote:
> > You can use the HttpServletResponse.sendError() method to send any kind 
> > of return code you want (including 404).
> 
> Yes, I just found that in the API docs. Is this the Right Way to do it? 
> Or should I be somehow wrapping the error in an Exception, or forwarding 
> to a View component?
> 
> I'm also looking for some Best Practices advice.
> 
> Thanks,
> 
> A.
> 
> 
> -- 
> Adam Sherman
> Software Developer
> Teach and Travel Inc.
> +1.613.241.3103
> 
> 
> 
> --
> 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]>

Reply via email to