tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Hookom" <hooko...@uwec.edu>
Subject RE: PAUL ...customize error page ini Servlet
Date Fri, 17 May 2002 15:49:50 GMT
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:Paul.Balanoiu@Siatel.RO] 
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" <Vaneet@iwg.info>
To: "'Tomcat Users List'" <tomcat-user@jakarta.apache.org>
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:Paul.Balanoiu@Siatel.RO]
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" <Vaneet@iwg.info>
To: "'Tomcat Users List'" <tomcat-user@jakarta.apache.org>
Sent: Friday, May 17, 2002 1:32 PM
Subject: RE: customize error page ini Servlet




-----Original Message-----
From: Vaneet Sharma [mailto:Vaneet@iwg.info]
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:ventural@libero.it]
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: staginfo-ar@cristal-union.fr [mailto:staginfo-ar@cristal-union.fr]
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:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

---
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:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message