BTW to the a person asking about 404 error pages:
Assuming I understood your question correctly, you customize error pages in your web.xml for your application or the web.xml for the application server using the <error-page> tags.
Please see the Java EE tutorial or search for "Tomcat error page customization" in your favorite search engine.
http://java.sun.com/javaee/5/docs/tutorial/doc/bnaeo.html#bnaet