Since you want to only setup your error pages once in the XML, on the servlet you can do (I believe)
HttpServletResponse.sendError( int ); HttpServletResponse.sendError( HttpServletResponse.SC_FORBIDDEN ); And it will automatically forward to the appropriate pre-configured 404, 405, etc error pages. -----Original Message----- From: Paul Balanoiu [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 7:31 AM To: Tomcat Users List Subject: Re: PAUL ...customize error page ini Servlet In the request (javax.servlet.request) you have the following method: public RequestDispatcher getRequestDispatcher(java.lang.String path) where you specify the new path. With the RequestDispatcher you can do the forwarding. Simply call the public void forward(ServletRequest request, ServletResponse response) method. Be carefull not to commit any writes in the initial servlet (uncommited data is automatically cleared, commited data results in an exception). Paul PS: The path should be something like this: "/pathtoerrorpage", and is interpreted as a relative path in the application (a relative path starting from the context root). ----- Original Message ----- From: "Vaneet Sharma" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Friday, May 17, 2002 3:20 PM Subject: RE: PAUL ...customize error page ini Servlet i am using servlets .. can you tell me the code .. how to do in servlets chao -----Original Message----- From: Paul Balanoiu [mailto:[EMAIL PROTECTED]] Sent: 17 May 2001 13:18 To: Tomcat Users List Subject: Re: customize error page ini Servlet 1. If you intend to use custom error pages for errors that are generated by tomcat (page not found for example), in the XML descriptor of the web application you can add tags like this one: <error-page> <error-code>404</error-code> <location>ErrorPage.jsp</location> </error-page> 2. If you want to send the user to a page (i.e. LoginError.jsp for example, when your code detected that the user/pass combination is invalid), the <jsp:forward> tag will do just fine. Paul ----- Original Message ----- From: "Vaneet Sharma" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Friday, May 17, 2002 1:32 PM Subject: RE: customize error page ini Servlet -----Original Message----- From: Vaneet Sharma [mailto:[EMAIL PROTECTED]] Sent: 17 May 2002 12:27 To: 'Tomcat Users List' Subject: customize error page ini Servlet Dear friends can anyone tell me how to customize error page in Servlet. when an error comes in my application, i want the user to redirected to my error page displaying the error. i am using velocity with Servlets on Tomcat 4.0.2 with JDK1.3 -----Original Message----- From: Luca Ventura [mailto:[EMAIL PROTECTED]] Sent: 17 May 2002 09:42 To: Tomcat Users List Subject: R: Ref. : How can I redirect only JSP pages to Tomcat? Thanks....I will try you solution but I hope someone else has already solved this problem....:-) Sorry..but I don't know how to put IIS and tomcat on different machine: I am curious to know how to do too! :-( Regards, Luca -----Messaggio originale----- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Inviato: venerdi 17 maggio 2002 8.55 A: Tomcat Users List Oggetto: Ref. : How can I redirect only JSP pages to Tomcat? I have the same problem. You can try to add : forwardAll="false" noRoot="false" in the IIS listener of your context in server.xml I've seen in tomcat doc this manip permits to redirect only Jsp&servlets but it doesn't work for me. Good luck! Jc ps: Do you know how can I put IIs & tomcat on different machines? -- 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]> -- 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]> -- 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]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>