custom error-pages

2002-07-10 Thread Daniel Collins





I was playing around with creating some custom error pages for a web application
(servlets and JSPs) and I'm not sure if what I am seeing is correct or not. I've
had a look around the archives but can't see anything about this particular
problem, but apologies if someone's already asked it (or I'm missing something
blindinly obvious!)

The application occasionally throws ClassCastExceptions in the JSPs (in essence
jsp:useBean finds a bean of the same name but wrong class and tries to cast it
unsuccessfully) which generate Error 500: Internal Servlet Errors, so I added
the following to my web.xml:

  
500
/errors/test.html
  

But it didn't work, it still gave me Tomcat's default error page. (And yes that
html file does exist relative to the web-root).

I then trapped the exception directly with the following:

  
java.lang.ClassCastException
/errors/test2.html
  

And it goes to the correct error page, why does the exception trapping work but
the error code not? (Yes they are different error pages, but it's just so I can
see which one is being produced for now).  I've tried this in both 3.3.1 and
4.0.4 with the same results, which implies to me that it's something in my
expectation that is wrong rather than tomcat.

Thanks,

Daniel


 Tertio Telecoms Limited  -  One Angel Square,   Torrens Street,   London  EC1V
1PL
Tel: +44 (0)20 7843 4000 Fax: +44 (0)20 7843 4001 Web http://www.tertio.com
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Tertio Ltd.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Custom error Pages

2001-02-12 Thread Yogesh Agarwal

Hi All:

I have set up tomcat/apache to host my web application. Now I want to throw custom 
error pages for 404/500 errors. I read in the archives that error-code tag in web.xml 
will work. I tried the same but it doesn't work. If somebody has faced the similar 
situation and come up with a solution, please help as early as possible. 

Thanx in advance

Yogesh

_
Tell the world you are a lazyreader. Get your free [EMAIL PROTECTED]
Visit http://freemail.lazyreader.com" target="_top">lazyreader.com for 
6MB of email space and an email address with personality!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Custom Error Pages

2003-06-19 Thread Thomas, Kevin
Hi all,

I have setup some custom error pages and have updated
$CATALINA_HOME/conf/web.xml to direct to these pages should an error occur.
However, when a error is raised the app automatically looks within
//Errors for the pages instead of /ROOT/Errors where I would like it
to look.

Errors is the name of a directory I have created BTW.

Any ideas as to why/how I can get the error pages to be picked up from
there?

I'm running Tomcat 4.0.6.

Cheers,
Kev.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



custom error pages?

2003-06-20 Thread seera naveen
Hi,
 
I am using FORM based authentication and JNDIRealm.  Is it possible to have custom 
error pages in Tomcat?  Apart from Invalid username and password, I want to check for 
another attribute and if that attribute is not set, I want to throw another message.
 
Thanks
Naveen

SMS using the Yahoo! Messenger;Download latest version.

custom error pages

2004-08-05 Thread Maurice Marrink
Hi,

I,m using tomcat 5.0.27 and am trying to show custom error pages.
I added a couple of errorpage tags to my webapps web.xml and the
/conf/web.xml in the tomcat installation dir.

500 
/error/error.html 

and after telling internet explorer not to use userfriendly errorpages it
shows the errorpages defined in my webapp when I try to access an
nonexisting url inside my webapps context (e.g.
/my_existing_webapp/does_not_exist.html) and shows the default errorpages
when I go to an url that does not exist at all (e.g.
/non_existing_webapp/whatever.html), that is after I copied my error files
into the ROOT context.
But I cant get it to work when my webapp is defined but not running. What I
did was this:
- start tomcat
- goto the manager webapp
- shutdown the webapp with custom errorpages
- enter a valid url for that webapp in the browser.

Now I get the standard tomcat errorpage.
So I did a little debugging and found that when tomcat stops a webapp, it
preserves the context it just strips it from all but the name (well almost).
So my custom defined errorpages are gone and because tomcat did find a
context it wont use the errorpages defined in the default web.xml (or root
context) but instead goes for the tomcat errorpage.

I thought I could outsmart tomcat, so I made a little lifecylelistener and
container listener so I would get notified of the removal of my errorpages
and then put them back in. Even though that works, tomcat still shows its
own errorpages because further down the line it tries to get a
requestdispatcher from the context (which was stripped) to forward the
request for the errorpages. And there it fails offcourse.

Now we get to the question(s) :)

- does anyone know what else needs to be preserved in the context in order
to deliver a valid requestdispatcher (there is a lot that gets removed, and
its probably quicker to get an answer from you guys then painstakingly use
trial and error)
- or perhaps a better question could you guys (developers) make the next
(nightly) release so that it tries to get errorpages from the default
web.xml (root context) before showing the tomcat errorpage. Because its more
then likely my little hack is going to break something if I get it to work.

If no one can or bothers to answer the first question I can live with that,
I've surrendered :) but I would like to see the 2nd request/ feature to
happen.

Thanks,

Maurice Marrink


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Custom error pages!!

2000-12-12 Thread Pankaj Bhagat




Hi ppl:
I had posted a very simple query..but had 
not received any comments. So am i the only unlucky person who's stuck on this 
simple problem. Any suggestions are welcome plz.
 
I want Custom error pages, in my application, the 
two solutions i have is to use the "ErrorDocument" directive in Apache or to use 
the "error-pages" xml element while deploying my servlet in Tomcat (please note 
that i am using Apache 1.3 and Tomcat 3.2). But somehow both of them are not 
responding to the changes i try to make. Am only getting some satisfaction if i 
try and call a page which does not exist through Apache (with 
netscape...IE...still does nothing).
 
Hoping to get some replies this time.
 
Regards
Pankaj


RE: custom error-pages

2002-07-10 Thread Ricky Leung

I asked about this before but it is according to spec so I did this instead.

  
java.lang.Exception
/errors/test.html
  

This is basically the same as a 500 with any type of exception catched and
presented with a better formatted page.



> -Original Message-
> From: Daniel Collins [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 10, 2002 10:36 AM
> To: [EMAIL PROTECTED]
> Subject: custom error-pages
>
>
>
>
>
>
> I was playing around with creating some custom error pages for a
> web application
> (servlets and JSPs) and I'm not sure if what I am seeing is
> correct or not. I've
> had a look around the archives but can't see anything about this
> particular
> problem, but apologies if someone's already asked it (or I'm
> missing something
> blindinly obvious!)
>
> The application occasionally throws ClassCastExceptions in the
> JSPs (in essence
> jsp:useBean finds a bean of the same name but wrong class and
> tries to cast it
> unsuccessfully) which generate Error 500: Internal Servlet
> Errors, so I added
> the following to my web.xml:
>
>   
> 500
> /errors/test.html
>   
>
> But it didn't work, it still gave me Tomcat's default error page.
> (And yes that
> html file does exist relative to the web-root).
>
> I then trapped the exception directly with the following:
>
>   
> java.lang.ClassCastException
> /errors/test2.html
>   
>
> And it goes to the correct error page, why does the exception
> trapping work but
> the error code not? (Yes they are different error pages, but it's
> just so I can
> see which one is being produced for now).  I've tried this in
> both 3.3.1 and
> 4.0.4 with the same results, which implies to me that it's something in my
> expectation that is wrong rather than tomcat.
>
> Thanks,
>
> Daniel
>
>
>  Tertio Telecoms Limited  -  One Angel Square,   Torrens Street,
>  London  EC1V
> 1PL
> Tel: +44 (0)20 7843 4000 Fax: +44 (0)20 7843 4001 Web
http://www.tertio.com
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Tertio
Ltd.



--
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]>




RE: Custom Error Pages

2003-06-19 Thread Shapira, Yoav

Howdy,
The url-pattern for error pages in web.xml is relative to your docBase.
C'est tout.

Yoav Shapira
Millennium ChemInformatics


>-Original Message-
>From: Thomas, Kevin [mailto:[EMAIL PROTECTED]
>Sent: Thursday, June 19, 2003 10:25 AM
>To: 'Tomcat Users List'
>Subject: Custom Error Pages
>
>Hi all,
>
>I have setup some custom error pages and have updated
>$CATALINA_HOME/conf/web.xml to direct to these pages should an error
occur.
>However, when a error is raised the app automatically looks within
>//Errors for the pages instead of /ROOT/Errors where I would
like
>it
>to look.
>
>Errors is the name of a directory I have created BTW.
>
>Any ideas as to why/how I can get the error pages to be picked up from
>there?
>
>I'm running Tomcat 4.0.6.
>
>Cheers,
>Kev.
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Custom Error Pages

2003-06-19 Thread Thomas, Kevin
Merci :O)

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 19 June 2003 15:28
To: Tomcat Users List
Subject: RE: Custom Error Pages



Howdy,
The url-pattern for error pages in web.xml is relative to your docBase.
C'est tout.

Yoav Shapira
Millennium ChemInformatics


>-Original Message-
>From: Thomas, Kevin [mailto:[EMAIL PROTECTED]
>Sent: Thursday, June 19, 2003 10:25 AM
>To: 'Tomcat Users List'
>Subject: Custom Error Pages
>
>Hi all,
>
>I have setup some custom error pages and have updated
>$CATALINA_HOME/conf/web.xml to direct to these pages should an error
occur.
>However, when a error is raised the app automatically looks within
>//Errors for the pages instead of /ROOT/Errors where I would
like
>it
>to look.
>
>Errors is the name of a directory I have created BTW.
>
>Any ideas as to why/how I can get the error pages to be picked up from
>there?
>
>I'm running Tomcat 4.0.6.
>
>Cheers,
>Kev.
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: custom error pages?

2003-06-21 Thread Yoav Shapira
Howdy,
Define an exception, e.g. MyException.  Define an error-page (in web.xml) for
that exception.  Throw that exception from your servlet.

Yoav Shapira

--- seera naveen <[EMAIL PROTECTED]> wrote:
> Hi,
>  
> I am using FORM based authentication and JNDIRealm.  Is it possible to have
> custom error pages in Tomcat?  Apart from Invalid username and password, I
> want to check for another attribute and if that attribute is not set, I want
> to throw another message.
>  
> Thanks
> Naveen
> 
> SMS using the Yahoo! Messenger;Download latest version.


=
Yoav Shapira
[EMAIL PROTECTED]

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: custom error pages?

2003-06-23 Thread Kevin Ritter
Greetings,

I too had this similar question about two weeks ago, only I was using Basic
authentication instead of form, but what helped me was this url:

developer.java.sun.com/developer/Books/ certification/pro_scwcd_chap04.pdf

Contains sample code.

Good luck
Kevin

-Original Message-
From: seera naveen [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 21, 2003 12:07 AM
To: [EMAIL PROTECTED]
Subject: custom error pages?

Hi,
 
I am using FORM based authentication and JNDIRealm.  Is it possible to have
custom error pages in Tomcat?  Apart from Invalid username and password, I
want to check for another attribute and if that attribute is not set, I want
to throw another message.
 
Thanks
Naveen

SMS using the Yahoo! Messenger;Download latest version.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: custom error pages

2004-08-05 Thread Mike Curwen
I think the essence of the request is to get Tomcat to not show a tomcat
error page under any circumstances.  For those using Tomcat stand-alone,
(ie: they do not have the benefit of being able to use custom apache error
pages), is there a solution?

If you say that errorpages specified in web.xml are part of the web app, and
so are not available unless the app is available, would this be more
appropriately handled by a customized Connector? ie: 

com.foo.my.Connector extends org.apache.coyote.tomcat4.CoyoteConnector
 
and then I can set up customized pages for 404, 500, etc, etc ?




> -Original Message-
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, August 05, 2004 8:11 AM
> To: Tomcat Users List
> Subject: RE: custom error pages
> 
> 
> 
> Hi,
> The stuff in conf/web.xml is virtually appended to your 
> web.xml.  If your web.xml is inactive or non-existent the 
> stuff in conf/web.xml is not applicable and not consulted.
> 
> 
> Yoav Shapira
> Millennium Research Informatics
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: custom error pages

2004-08-05 Thread Shapira, Yoav

Hi,
Of course, you could write a customized Connector to do this.  Or you
could have an entirely separate server dedicated to error messages and
forward there from your custom connector.  Or whatever.  If you want to
go as far as to write a custom Connector to do this, you could do a lot
of other things.  My answer was in terms of current tomcat
code/features, there's no configurable setting to do this.  One of the
main benefits of an open source server with the Apache license is that
you can do whatever you want with it...

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Mike Curwen [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 05, 2004 2:44 PM
>To: 'Tomcat Users List'
>Subject: RE: custom error pages
>
>I think the essence of the request is to get Tomcat to not show a
tomcat
>error page under any circumstances.  For those using Tomcat
stand-alone,
>(ie: they do not have the benefit of being able to use custom apache
error
>pages), is there a solution?
>
>If you say that errorpages specified in web.xml are part of the web
app,
>and
>so are not available unless the app is available, would this be more
>appropriately handled by a customized Connector? ie:
>
>com.foo.my.Connector extends org.apache.coyote.tomcat4.CoyoteConnector
>
>and then I can set up customized pages for 404, 500, etc, etc ?
>
>
>
>
>> -Original Message-
>> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, August 05, 2004 8:11 AM
>> To: Tomcat Users List
>> Subject: RE: custom error pages
>>
>>
>>
>> Hi,
>> The stuff in conf/web.xml is virtually appended to your
>> web.xml.  If your web.xml is inactive or non-existent the
>> stuff in conf/web.xml is not applicable and not consulted.
>>
>>
>> Yoav Shapira
>> Millennium Research Informatics
>>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom error pages!!

2000-12-12 Thread Kief Morris

Pankaj Bhagat typed the following on 11:17 12/12/2000 +0100
>I want Custom error pages, in my application, the two solutions i have is to use the 
>"ErrorDocument" directive in Apache or to use the "error-pages" xml element while 
>deploying my servlet in Tomcat (please note that i am using Apache 1.3 and Tomcat 
>3.2). But somehow both of them are not responding to the changes i try to make. Am 
>only getting some satisfaction if i try and call a page which does not exist through 
>Apache (with netscape...IE...still does nothing).

I don't completely understand what you're trying to do. What kinds of errors are you
trying to catch with customized pages, and what are you doing to test it? 

JSP errors pages will only be displayed by Tomcat when there is a Java exception
processing a JSP page which has the error page configured like:

<%@ page language="java" errorPage="/error.jsp"%>

It won't work if the exception is thrown after the headers have already been sent
to the client, as when you use autoFlush=true.

The Apache httpd error pages aren't really on topic here, since they don't involve
Tomcat.

Kief


---
  bitBull makes the Internet bite: http://www.bitBull.com/demos/




Re: Custom error pages!!

2000-12-12 Thread Pankaj Bhagat

Thanks Kief for your fast response.
I'll try and explain in a better way what i am tryin to achieve.

I am presently working on a product and here all the calls to jsp/html/etc.
are routed through a single servlet. And we are using Apache 1.3 as the web
server and Tomcat 3.2 as the servlet/jsp runner.
Now what i wish to do is to catch an exception which may occur anywhere but
is passed on to this servlet and then redirect me to a specific error page.
So i can have general exceptions like "ObjectNotFoundException" which may
occur in any page but being passed on to the servlet.

Now for this i was exploring the option in Tomcat3.2 (rather in the servlet
2.2 spec.'s) which say that at the time of deployment of a servlet we can
also specify certain specific error pages in the web.xml file with the tags
"error-pages".

So now what i can understand is that it should be Tomcat's problem to
intercept any errors occuring in the servlet and then passing me onto the
specified url in the deployment descriptor.

Now just to take no chances i also did some configuration in Apache also
(using the directive "ErrorDocument")but think this can be ignored
right now.

Hope the problem is a bit more clear. And hope you can suggest me some
alternative.

Regards
Pankaj



- Original Message -
From: "Kief Morris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 11:35 AM
Subject: Re: Custom error pages!!


> Pankaj Bhagat typed the following on 11:17 12/12/2000 +0100
> >I want Custom error pages, in my application, the two solutions i have is
to use the "ErrorDocument" directive in Apache or to use the "error-pages"
xml element while deploying my servlet in Tomcat (please note that i am
using Apache 1.3 and Tomcat 3.2). But somehow both of them are not
responding to the changes i try to make. Am only getting some satisfaction
if i try and call a page which does not exist through Apache (with
netscape...IE...still does nothing).
>
> I don't completely understand what you're trying to do. What kinds of
errors are you
> trying to catch with customized pages, and what are you doing to test it?
>
> JSP errors pages will only be displayed by Tomcat when there is a Java
exception
> processing a JSP page which has the error page configured like:
>
> <%@ page language="java" errorPage="/error.jsp"%>
>
> It won't work if the exception is thrown after the headers have already
been sent
> to the client, as when you use autoFlush=true.
>
> The Apache httpd error pages aren't really on topic here, since they don't
involve
> Tomcat.
>
> Kief
>
>
> ---
>   bitBull makes the Internet bite:
http://www.bitBull.com/demos/
>




Re: Custom error pages!!

2000-12-12 Thread Kief Morris

Pankaj Bhagat typed the following on 11:58 12/12/2000 +0100
>So now what i can understand is that it should be Tomcat's problem to
>intercept any errors occuring in the servlet and then passing me onto the
>specified url in the deployment descriptor.

I believe this only applies to JSP pages. For your servlet, you should just
catch it normally:

public void doGet (...)
{
try {
// your code here
} catch (Throwable e) {
// forward to an error page
}
// write headers and output
}

If you want to take advantage of JSP error page handling, a slick thing to do 
might be to insert the Throwable object into the request as an attribute 
named "javax.servlet.jsp.jspException", then forward to a JSP page whose 
page directive includes the parameter isErrorPage="true". This will automatically
create a variable called "exception" in the error page, which will be a reference
to the Throwable object you set in the request.

Check out section 2.7.1 of the JSP specification document for details on how
this works.

Kief

---
  bitBull makes the Internet bite: http://www.bitBull.com/demos/




Re: Custom error pages!!

2000-12-12 Thread Pankaj Bhagat

Thanks for your response. The solution really sounds good.

But just for information, can you comment on the  tag not
working in the deployment descriptor of Tomcat 3.2

Anybody else who has been successful with this can also plese comment.

Regards
Pankaj
- Original Message -
From: "Kief Morris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 12:26 PM
Subject: Re: Custom error pages!!


> Pankaj Bhagat typed the following on 11:58 12/12/2000 +0100
> >So now what i can understand is that it should be Tomcat's problem to
> >intercept any errors occuring in the servlet and then passing me onto the
> >specified url in the deployment descriptor.
>
> I believe this only applies to JSP pages. For your servlet, you should
just
> catch it normally:
>
> public void doGet (...)
> {
> try {
> // your code here
> } catch (Throwable e) {
> // forward to an error page
> }
> // write headers and output
> }
>
> If you want to take advantage of JSP error page handling, a slick thing to
do
> might be to insert the Throwable object into the request as an attribute
> named "javax.servlet.jsp.jspException", then forward to a JSP page whose
> page directive includes the parameter isErrorPage="true". This will
automatically
> create a variable called "exception" in the error page, which will be a
reference
> to the Throwable object you set in the request.
>
> Check out section 2.7.1 of the JSP specification document for details on
how
> this works.
>
> Kief
>
> ---
>   bitBull makes the Internet bite:
http://www.bitBull.com/demos/
>




AW: Custom error pages!!

2000-12-12 Thread Amrhein, Thomas

Hi,

How is your  named?
I use JSP and have found, that the  itself has to be a
.jsp-file.
With .html it did not work (Tomcat 3.2b6). Haven't tested 3.2 (final).
But I don't expect any changes.

Try to name your error-page a .jsp-file and retry it. Perhaps it works.

regards,

Thomas


-Ursprüngliche Nachricht-
Von: Pankaj Bhagat [mailto:[EMAIL PROTECTED]]
Gesendet am: Dienstag, 12. Dezember 2000 12:59
An: [EMAIL PROTECTED]
Betreff: Re: Custom error pages!!

Thanks for your response. The solution really sounds good.

But just for information, can you comment on the  tag not
working in the deployment descriptor of Tomcat 3.2

Anybody else who has been successful with this can also plese comment.

Regards
Pankaj
- Original Message -
From: "Kief Morris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 12:26 PM
Subject: Re: Custom error pages!!


> Pankaj Bhagat typed the following on 11:58 12/12/2000 +0100
> >So now what i can understand is that it should be Tomcat's problem to
> >intercept any errors occuring in the servlet and then passing me onto the
> >specified url in the deployment descriptor.
>
> I believe this only applies to JSP pages. For your servlet, you should
just
> catch it normally:
>
> public void doGet (...)
> {
> try {
> // your code here
> } catch (Throwable e) {
> // forward to an error page
> }
> // write headers and output
> }
>
> If you want to take advantage of JSP error page handling, a slick thing to
do
> might be to insert the Throwable object into the request as an attribute
> named "javax.servlet.jsp.jspException", then forward to a JSP page whose
> page directive includes the parameter isErrorPage="true". This will
automatically
> create a variable called "exception" in the error page, which will be a
reference
> to the Throwable object you set in the request.
>
> Check out section 2.7.1 of the JSP specification document for details on
how
> this works.
>
> Kief
>
> ---
>   bitBull makes the Internet bite:
http://www.bitBull.com/demos/
>



Re: Custom error pages!!

2000-12-12 Thread Kief Morris

Pankaj Bhagat typed the following on 12:58 12/12/2000 +0100
>But just for information, can you comment on the  tag not
>working in the deployment descriptor of Tomcat 3.2

I just tried it, it works fine for me. Are you specifying the full names of the
exceptions? e.g. java.lang.IllegalArgumentException rather than just
IllegalArgumentException.

Here's what worked for me in my WEB-INF/web.xml file, Tomcat 3.2 final.


404
/not_found.jsp



java.lang.NullPointerException
/error.jsp


Kief

---
  bitBull makes the Internet bite: http://www.bitBull.com/demos/




Re: Custom error pages!!

2000-12-12 Thread Pankaj Bhagat

Thanks a lot for ur help atleast now i am atleast near to the solution.

Hey but i was just aping what you suggested and it worked.

The only difference in what i was trying previously and this one is that
for an error page i was going to an html file whereas now its
working if i redirect to a jsp.

Dont know why.but till the time it works i guess its fine.

I also dont know if thats a bug with Tomcat 3.2 or not.

Thanks and Regards
Pankaj
- Original Message -
From: "Kief Morris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 1:32 PM
Subject: Re: Custom error pages!!


> Pankaj Bhagat typed the following on 12:58 12/12/2000 +0100
> >But just for information, can you comment on the  tag not
> >working in the deployment descriptor of Tomcat 3.2
>
> I just tried it, it works fine for me. Are you specifying the full names
of the
> exceptions? e.g. java.lang.IllegalArgumentException rather than just
> IllegalArgumentException.
>
> Here's what worked for me in my WEB-INF/web.xml file, Tomcat 3.2 final.
>
> 
> 404
> /not_found.jsp
> 
>
> 
> java.lang.NullPointerException
> /error.jsp
> 
>
> Kief
>
> ---
>   bitBull makes the Internet bite:
http://www.bitBull.com/demos/
>




Re: Custom error pages!!

2000-12-12 Thread Kief Morris

Pankaj Bhagat typed the following on 14:58 12/12/2000 +0100
>The only difference in what i was trying previously and this one is that
>for an error page i was going to an html file whereas now its
>working if i redirect to a jsp.

Aha, someone else just pointed this out.

>Dont know why.but till the time it works i guess its fine.
>
>I also dont know if thats a bug with Tomcat 3.2 or not.

I think there is a bug, the spec says:

"The location element contains the location of the resource in the
web application relative to the root of the web application. The
value of the location must have a leading ‘/’."

The spec seems to include static (html, gif) files in its definition of "resources",
so it ought to work.

I tried it with an html file and Tomcat chokes: I get:

java.lang.StackOverflowError 
at java.io.FileNotFoundException.(FileNotFoundException.java:62) 
at java.io.FileInputStream.open(Native Method) 
at java.io.FileInputStream.(FileInputStream.java:64) 
at java.io.FileInputStream.(FileInputStream.java:95) 
at org.apache.tomcat.request.FileHandler.doService(StaticInterceptor.java:365) 
at org.apache.tomcat.core.Handler.service(Handler.java:286) at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at 
org.apache.tomcat.core.ContextManager.handleStatus(ContextManager.java:1049) at 
org.apache.tomcat.request.FileHandler.doService(StaticInterceptor.java:387) at 
org.apache.tomcat.core.Handler.service(Handler.java:286) at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) 

... seems to be a recursive loop.

My web.xml file contains:


404
/foo.html



java.lang.NullPointerException
/foo.html


And /foo.html definitely exists, I can view it normally if I point my browser
straight at it.

I'll report the bug.


---
  bitBull makes the Internet bite: http://www.bitBull.com/demos/




Re: Custom error pages!!

2000-12-12 Thread Pankaj Bhagat

yup that sure is the problem i was also getting.

thanks for helping me outta that...

n cheers.
v have found a bug..hahahaha

so guess a lot of ppl. like us wont have to waste their time on it

regards
Pankaj
- Original Message -
From: "Kief Morris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 3:41 PM
Subject: Re: Custom error pages!!


> Pankaj Bhagat typed the following on 14:58 12/12/2000 +0100
> >The only difference in what i was trying previously and this one is that
> >for an error page i was going to an html file whereas now its
> >working if i redirect to a jsp.
>
> Aha, someone else just pointed this out.
>
> >Dont know why.but till the time it works i guess its fine.
> >
> >I also dont know if thats a bug with Tomcat 3.2 or not.
>
> I think there is a bug, the spec says:
>
> "The location element contains the location of the resource in the
> web application relative to the root of the web application. The
> value of the location must have a leading '/'."
>
> The spec seems to include static (html, gif) files in its definition of
"resources",
> so it ought to work.
>
> I tried it with an html file and Tomcat chokes: I get:
>
> java.lang.StackOverflowError
> at java.io.FileNotFoundException.(FileNotFoundException.java:62)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.(FileInputStream.java:64)
> at java.io.FileInputStream.(FileInputStream.java:95)
> at
org.apache.tomcat.request.FileHandler.doService(StaticInterceptor.java:365)
> at org.apache.tomcat.core.Handler.service(Handler.java:286) at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at
org.apache.tomcat.core.ContextManager.handleStatus(ContextManager.java:1049)
at
org.apache.tomcat.request.FileHandler.doService(StaticInterceptor.java:387)
at org.apache.tomcat.core.Handler.service(Handler.java:286) at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>
> ... seems to be a recursive loop.
>
> My web.xml file contains:
>
> 
> 404
> /foo.html
> 
>
> 
> java.lang.NullPointerException
> /foo.html
> 
>
> And /foo.html definitely exists, I can view it normally if I point my
browser
> straight at it.
>
> I'll report the bug.
>
>
> ---
>   bitBull makes the Internet bite:
http://www.bitBull.com/demos/
>




Re: Custom error pages!!

2000-12-12 Thread Shahed Ali

I dont know about the specs, but I think all errorpages need the iserrorpage
= true page directive.

So that could mean that they should be .jsp (?)

Shahed




Re: Custom error pages!!

2000-12-12 Thread Kief Morris

Shahed Ali typed the following on 08:49 12/12/2000 -0600
>I dont know about the specs, but I think all errorpages need the iserrorpage
>= true page directive.
>
>So that could mean that they should be .jsp (?)

The spec doesn't seem to say this ... I believe that's just needed if you want 
the exception to be available in the JSP page with the variable "exception".
Tomcat 3.2 forwards errors to JSP pages which don't have isErrorPage=true
without any problems.

Kief
---
  bitBull makes the Internet bite: http://www.bitBull.com/demos/




Re: Custom error pages!!

2000-12-12 Thread Catherine Jung

Hiya,

> n cheers.
> v have found a bug..hahahaha

Boy mailing lists have a short memory!, I'd been having trouble with this
last week and posted about it, on tomcat-dev too, but to no avail. 

> so guess a lot of ppl. like us wont have to waste their time on it

 If my experience is anything to go by, I expect this topic to rear
it's head again about Monday. 

No-one seems to check the archives/bug database these days :)

Catherine.
 




Re: Custom error pages!!

2000-12-12 Thread Alexandre Simonin

Catherine,

I'm new to this mailing-list and reviewing the WELCOME notice, I found no
trace related to the database you're refering to. Can you please provide me
with the directions?

Thanks in advance,
Alexandre

Catherine Jung wrote:

> Hiya,
>
> > n cheers.
> > v have found a bug..hahahaha
>
> Boy mailing lists have a short memory!, I'd been having trouble with this
> last week and posted about it, on tomcat-dev too, but to no avail.
>
> > so guess a lot of ppl. like us wont have to waste their time on it
>
>  If my experience is anything to go by, I expect this topic to rear
> it's head again about Monday.
>
> No-one seems to check the archives/bug database these days :)
>
> Catherine.
>




Re: Custom error pages!!

2000-12-12 Thread Catherine Jung

Hiya, 

No problem, if you go to the Tomcat site:

jakarta.apache.org/tomcat/index.html

it has links to both the bug report/search site:

http://znutar.cortexity.com/BugRatViewer/

and the searchable mailing list archives:

http://mikal.org/interests/java/tomcat/index.html

Hope it helps,

Catherine

> I'm new to this mailing-list and reviewing the WELCOME notice, I found no
> trace related to the database you're refering to. Can you please provide me
> with the directions?

> Thanks in advance,
> Alexandre




Re: Custom error pages!!

2000-12-12 Thread Kief Morris

Catherine Jung typed the following on 16:18 12/12/2000 +
>Boy mailing lists have a short memory!, I'd been having trouble with this
>last week and posted about it, on tomcat-dev too, but to no avail. 
>
>No-one seems to check the archives/bug database these days :)

Actually I did look, but I didn't see it in there. Actually, I don't find my own 
when I search for it either, although it's in the database.

If I get the time I'll look at fixing it myself: I found the place in the source
where it's happening, but I don't understand the context well enough yet
to fix it.

Kief

---
  bitBull makes the Internet bite: http://www.bitBull.com/demos/




Custom error pages from servlets?

2001-02-07 Thread Les Hartzman

Using Tomcat 3.2.1, is it possible to define/display custom error pages
based on errors that occur within a servlet?  No JSPs are used; this is a
servlet/EJB environment.

I've seen in the spec  for web.xml that there is an error-page element for
either a general error code or an exception type.  But is final granularity
possible based on some servlet action?

Thanks.

Les


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Custom Error Pages ... URGENT... Frustrated!!

2001-02-08 Thread Dan Sojka
Title: Custom Error Pages ... URGENT... Frustrated!!





I have posted this problem a few times. I want to simply catch a 404 in tomcat
and have and bring up a  custom jsp page. 


 I have tried in web xml ->>
  
    404
    /404.jsp
 


I have tried pointing the location at a servet .. but still to no avail. I don't know what to do
and I need to catch these 404's.  If anyone has had this problem and knows of a solution 
please let me know.. I feel I have exhausted every lead and I might have to customize 
the JspServlet to redirect for me in case of a 404.. 


--> Apache &  tomcat 3.2.1 


Thank-you 





Custom Error Pages ... URGENT... Frustrated!!

2001-02-08 Thread Dan Sojka
Title: Custom Error Pages ... URGENT... Frustrated!!





I have posted this problem a few times. I want to simply catch a 404 in tomcat
and have and bring up a  custom jsp page. 


 I have tried in web xml ->>
  
    404
    /404.jsp
 


I have tried pointing the location at a servet .. but still to no avail. I don't know what to do
and I need to catch these 404's.  If anyone has had this problem and knows of a solution 
please let me know.. I feel I have exhausted every lead and I might have to customize 
the JspServlet to redirect for me in case of a 404.. 


--> Apache &  tomcat 3.2.1 


Thank-you 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]





Custom Error Pages ... URGENT... Frustrated!

2001-02-08 Thread Dan Sojka
Title: Custom Error Pages ... URGENT... Frustrated!





I have posted this problem a few times. I want to simply catch a 404 in tomcat
and have and bring up a  custom jsp page. 


 I have tried in web xml ->>
  
    404
    /404.jsp
 


I have tried pointing the location at a servet .. but still to no avail. I don't know what to do
and I need to catch these 404's.  If anyone has had this problem and knows of a solution 
please let me know.. I feel I have exhausted every lead and I might have to customize 
the JspServlet to redirect for me in case of a 404.. 


--> Apache &  tomcat 3.2.1 


Thank-you 





Custom error pages & Internet Explorer

2003-06-11 Thread Lee W
Hi,

I have just started learning JSP & Tomcat so please be gentle.

I am currently designing a webapp and was trying to get some custom 
error pages working (currently just to handle 404, page cannot be 
found).  However they don't seem to work in Internet Explorer.

All of the default Tomcat errors work fine and so do my custom ones when 
viewed in Mozilla, however IE just displays the default Microsoft errors.

I though that maybe IE was using the HTTP return code in order to 
determine which page was displayed so I try changing that code using (in 
the custom error jsp page):

	response.setStatus() - with codes SC_OK, SC_MOVE_TEMPORARILY

All this ended up doing is was breaking Mozilla & causing the default 
Tomcat errors to come back.

Searching though the achives someone posted a similar problem last year 
but either the archive does not have the replies or no-one replied to 
the poster.

Any help here would be appreciated.

Regards

Lee

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: AW: Custom error pages!!

2000-12-12 Thread Catherine Jung

On Tue, 12 Dec 2000, Amrhein, Thomas wrote:

> With .html it did not work (Tomcat 3.2b6). Haven't tested 3.2 (final).

Nope - using a location tag pointing to an html file doesn't work in
either b7 or FINAL either (Stack overflow errors after tomcat
seems to get in a loop repeatedly calling the page) however pointing
it to a jsp does work.  

I haven't read anything in the specs to suggest it shouldn't work when
pointing to an html file (in fact all the examples I've seen point to html
files) and it makes no difference if you catch an error code (eg 404) or a
specific error type. I've submitted a bug report, but having no other 2.2
compliant Servlet engine to use I've not been able to test it anywhere
else.

> Thanks for your response. The solution really sounds good.
> 
> But just for information, can you comment on the  tag not
> working in the deployment descriptor of Tomcat 3.2
> 
> Anybody else who has been successful with this can also plese comment.

> Regards
> Pankaj

Catherine




Re: AW: Custom error pages!!

2000-12-12 Thread Pankaj Bhagat

Hi Catherine:

Thanks for your comments. A further extension to the problem : now something
seem to go wrong even while redirecting to a jsp for an error code, say
404
the required jsp is not being displyedbut am still getting a 404
error on the browser.
(i have tested this out with my deployment descriptor as well as the default
one)

ne comments are welcome.

regards
pankaj


- Original Message -
From: "Catherine Jung" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 5:04 PM
Subject: Re: AW: Custom error pages!!


> On Tue, 12 Dec 2000, Amrhein, Thomas wrote:
>
> > With .html it did not work (Tomcat 3.2b6). Haven't tested 3.2 (final).
>
> Nope - using a location tag pointing to an html file doesn't work in
> either b7 or FINAL either (Stack overflow errors after tomcat
> seems to get in a loop repeatedly calling the page) however pointing
> it to a jsp does work.
>
> I haven't read anything in the specs to suggest it shouldn't work when
> pointing to an html file (in fact all the examples I've seen point to html
> files) and it makes no difference if you catch an error code (eg 404) or a
> specific error type. I've submitted a bug report, but having no other 2.2
> compliant Servlet engine to use I've not been able to test it anywhere
> else.
>
> > Thanks for your response. The solution really sounds good.
> >
> > But just for information, can you comment on the  tag not
> > working in the deployment descriptor of Tomcat 3.2
> >
> > Anybody else who has been successful with this can also plese comment.
>
> > Regards
> > Pankaj
>
> Catherine
>




Re: AW: Custom error pages!!

2000-12-14 Thread Scott Jones

I'm trying to set up a custom error page for Cocoon & Tomcat.  So, I've
disabled the internal Cocoon error handling, and then I tried to add an
error-page descriptor to web-xml.  Ideally, I'd like to re-direct to a jsp
file that then would report the error to me by email.


500
/errors/error.jsp


However, this doesn't seem to work at all -- an error in a Cocoon page will
just give me a plain-ol' stack dump like I normally get from Tomcat.  Does
anyone have any suggestions for this?

Of course, I've written my code to be completely robust, so no errors will
ever occur (this is just for completeness)...  ;)

Thanks!

-Scott

- Original Message -
From: "Catherine Jung" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 8:04 AM
Subject: Re: AW: Custom error pages!!


> On Tue, 12 Dec 2000, Amrhein, Thomas wrote:
>
> > With .html it did not work (Tomcat 3.2b6). Haven't tested 3.2 (final).
>
> Nope - using a location tag pointing to an html file doesn't work in
> either b7 or FINAL either (Stack overflow errors after tomcat
> seems to get in a loop repeatedly calling the page) however pointing
> it to a jsp does work.
>
> I haven't read anything in the specs to suggest it shouldn't work when
> pointing to an html file (in fact all the examples I've seen point to html
> files) and it makes no difference if you catch an error code (eg 404) or a
> specific error type. I've submitted a bug report, but having no other 2.2
> compliant Servlet engine to use I've not been able to test it anywhere
> else.
>
> > Thanks for your response. The solution really sounds good.
> >
> > But just for information, can you comment on the  tag not
> > working in the deployment descriptor of Tomcat 3.2
> >
> > Anybody else who has been successful with this can also plese comment.
>
> > Regards
> > Pankaj
>
> Catherine
>
>




Re: AW: Custom error pages!!

2000-12-15 Thread Kief Morris

Scott Jones typed the following on 12:33 14/12/2000 -0800
>
>500
>/errors/error.jsp
>
>
>However, this doesn't seem to work at all -- an error in a Cocoon page will
>just give me a plain-ol' stack dump like I normally get from Tomcat.  Does
>anyone have any suggestions for this?

Some things you might try:
- See what happens when you do this for a 400 error, and then try to 
  access a non-existent page.
- See what happens if you make an error-page to catch exceptions:


java.lang.Throwable
/errors/error.jsp


It seems likely that may be that exception handling code handles the error
in preference to the error page code. This could be tested with a test servlet 
that explicitly returns a 500 response without throwing an exception:

doGet (...) ... 
{
response.sendError(SC_INTERNAL_SERVER_ERROR);
return;
}

My guess is this would display your error page.

Kief

---
  bitBull makes the Internet bite: http://www.bitBull.com/demos/




Re: AW: Custom error pages!!

2000-12-15 Thread Pankaj Bhagat

Hi:
Just to continue on the proposed solutions.

I was getting similar problems with Apache1.3 and Tomcat 3.2 (final)

in my case whenever an exception occurs Tomcat setting (in the web.xml)
would catch the exception and successfully redirect to an error page.
But in case of error codes somehow.it just would not happen...

i even tried the solution proposed by Kief..i.e. res.sendError("my
error code")
but somehow this also would not work

so finally i had to tweak by program to return an exception in case of a
page not found error also.
for the time being it has solved my problem as the deadline is near but feel
its not a good solution.

cheers
Pankaj
- Original Message -
From: "Kief Morris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 15, 2000 12:31 PM
Subject: Re: AW: Custom error pages!!


> Scott Jones typed the following on 12:33 14/12/2000 -0800
> >
> >500
> >/errors/error.jsp
> >
> >
> >However, this doesn't seem to work at all -- an error in a Cocoon page
will
> >just give me a plain-ol' stack dump like I normally get from Tomcat.
Does
> >anyone have any suggestions for this?
>
> Some things you might try:
> - See what happens when you do this for a 400 error, and then try to
>   access a non-existent page.
> - See what happens if you make an error-page to catch exceptions:
>
> 
> java.lang.Throwable
> /errors/error.jsp
> 
>
> It seems likely that may be that exception handling code handles the error
> in preference to the error page code. This could be tested with a test
servlet
> that explicitly returns a 500 response without throwing an exception:
>
> doGet (...) ...
> {
> response.sendError(SC_INTERNAL_SERVER_ERROR);
> return;
> }
>
> My guess is this would display your error page.
>
> Kief
>
> ---
>   bitBull makes the Internet bite:
http://www.bitBull.com/demos/
>




RE: AW: Custom error pages!!

2000-12-15 Thread Alexander Telnikoff

Has anybody sucessfuly configured Tomcat with Apache/mod_jk to use different
instances of Tomcat for different virtual domains? I do everything as per
documentation, i.e. start two versions of Tomcat specifying different
server.xml files, but get error "address already in use" when it comes to
opening ports for ajp12. The error message doesn't say which particular
address is in use. It seems Tomcat uses at least 2 ports per instance, one
is 8080 and the other one is typically, 8007 or whatever. If I only use one
port per instance, it won't load. If I use different ports (say 8081 and
8008) it loads but dosen't serve the servlets. I am wondering if anybody has
managed to do this.

Alexander






Custom error pages and BASIC authorization

2002-08-09 Thread Joe Tomcat

Hello fellow Tomcat users.  I am trying to set up a very simple web app
that has only static html pages.  I want it to use BASIC authorization
for just a few users.  Simple stuff, right?  I added the user and role
that I wanted in the tomcat-users.xml file, and then I put this in the
web.xml file for the application (which happens to be the ROOT
application):




  404
  /errors/404.html



  401
  /errors/401.html



  
   PrivateStuff
   /private/*
  

  
   PrivateUsers
  



  BASIC
  Private




I have a /index.html file which has a link to /PrivateStuff.  The user
clicks the link and should be prompted for a username and password,
right?  Wrong!  It goes immediately to the not authorized page in
/errors/401.html.  If I take the two error-page sections out of web.xml,
then everything works correctly, but I get the Tomcat default error
pages for file not found and auth error.  Showing default server error
pages looks quite unprofessional, so I want to not do this.  Any
sugestions?

Thanks!

Btw, is there any company which sells commercial support for Tomcat?



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Custom error pages from servlets?

2001-02-07 Thread Pete Ehli

catch try blocks - out.println(Your custom error message!);
-- Pete --
- Original Message -
From: "Les Hartzman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 4:36 PM
Subject: Custom error pages from servlets?


> Using Tomcat 3.2.1, is it possible to define/display custom error pages
> based on errors that occur within a servlet?  No JSPs are used; this is a
> servlet/EJB environment.
>
> I've seen in the spec  for web.xml that there is an error-page element for
> either a general error code or an exception type.  But is final
granularity
> possible based on some servlet action?
>
> Thanks.
>
> Les
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Custom error pages from servlets?

2001-02-08 Thread Kief Morris

Les Hartzman typed the following on 04:36 PM 2/7/2001 -0800
>Using Tomcat 3.2.1, is it possible to define/display custom error pages
>based on errors that occur within a servlet?  No JSPs are used; this is a
>servlet/EJB environment.
>
>I've seen in the spec  for web.xml that there is an error-page element for
>either a general error code or an exception type.  But is final granularity
>possible based on some servlet action?

I'm not sure what you mean by that last sentence. You can throw
whatever exceptions you want in your servlet to force handling by
a particular error page. Create custom exception subclasses and
throw those in your servlet.


com.myco.myproject.FooException
/servlets/FooExceptionServlet)


Section 9.8 of the 2.2 specification explains how to find the error conditions in 
your servlet.

Note that there has been a bug which causes Tomcat to choke if you use
a non JSP/servlet resource to handle error-pages, i.e. using a flat HTML page
kills it. I'm not sure if this is still a bug. 

Kief


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Custom Error Pages ... URGENT... Frustrated!

2001-02-08 Thread Ignacio J. Ortega

Please Post a bug at bugzilla (http://nagoya.apache.org/bugzilla ) but
repeating it on the list, will not get this olved , if it's an issue (
thing which i dont know ) i will try to have a look at that.. 

Saludos ,
Ignacio J. Ortega

-Mensaje original-
De: Dan Sojka [mailto:[EMAIL PROTECTED]]
Enviado el: jueves 8 de febrero de 2001 23:52
Para: '[EMAIL PROTECTED]'
Asunto: Custom Error Pages ... URGENT... Frustrated!


I have posted this problem a few times. I want to simply catch a 404 in
tomcat 
and have and bring up a custom jsp page. 
I have tried in web xml - 
error-page 
 error-code404/error-code 
 location/404.jsp/location 
/error-page 
I have tried pointing the location at a servet .. but still to no avail.
I don't know what to do 
and I need to catch these 404's. If anyone has had this problem and
knows of a solution 
please let me know.. I feel I have exhausted every lead and I might have
to customize 
the JspServlet to redirect for me in case of a 404.. 
-- Apache  tomcat 3.2.1 
Thank-you 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Custom Error Pages ... URGENT... Frustrated!

2001-02-08 Thread Ignacio J. Ortega

And please do not post html to the maillists, follow guidelines at
http://jakarta.apache.org/site/mail.html

Saludos ,
Ignacio J. Ortega

-Mensaje original-
De: Dan Sojka [mailto:[EMAIL PROTECTED]]
Enviado el: jueves 8 de febrero de 2001 23:52
Para: '[EMAIL PROTECTED]'
Asunto: Custom Error Pages ... URGENT... Frustrated!


I have posted this problem a few times. I want to simply catch a 404 in
tomcat 
and have and bring up a custom jsp page. 
I have tried in web xml - 
error-page 
 error-code404/error-code 
 location/404.jsp/location 
/error-page 
I have tried pointing the location at a servet .. but still to no avail.
I don't know what to do 
and I need to catch these 404's. If anyone has had this problem and
knows of a solution 
please let me know.. I feel I have exhausted every lead and I might have
to customize 
the JspServlet to redirect for me in case of a 404.. 
-- Apache  tomcat 3.2.1 
Thank-you 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Custom error pages & Internet Explorer

2003-06-11 Thread Tim Robinson
try tools/internet options/advanced

uncheck 'show friendly HTTP error messages' and you should see the actual
error returned.

If it is checked, IE masks all errors with it's blanket 'friendly' (i.e.
useless message).

Unfortunately this is a browser setting, so nothing you can do about it on
the server.

--- Tim


> -Original Message-
> From: Lee W [mailto:[EMAIL PROTECTED]
> Sent: 11 June 2003 14:29
> To: [EMAIL PROTECTED]
> Subject: Custom error pages & Internet Explorer
>
>
> Hi,
>
> I have just started learning JSP & Tomcat so please be gentle.
>
> I am currently designing a webapp and was trying to get some custom
> error pages working (currently just to handle 404, page cannot be
> found).  However they don't seem to work in Internet Explorer.
>
> All of the default Tomcat errors work fine and so do my
> custom ones when
> viewed in Mozilla, however IE just displays the default
> Microsoft errors.
>
> I though that maybe IE was using the HTTP return code in order to
> determine which page was displayed so I try changing that
> code using (in
> the custom error jsp page):
>
>   response.setStatus() - with codes SC_OK, SC_MOVE_TEMPORARILY
>
> All this ended up doing is was breaking Mozilla & causing the default
> Tomcat errors to come back.
>
> Searching though the achives someone posted a similar problem
> last year
> but either the archive does not have the replies or no-one replied to
> the poster.
>
> Any help here would be appreciated.
>
> Regards
>
> Lee
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom error pages & Internet Explorer

2003-06-11 Thread Michael Duffy

Hi Lee,

Do you have  tags in your web.xml?  You
can tell Tomcat to send 404 errors to a JSP of your
choosing by adding something like this to web.xml,
after  and before :


404
/not-found.jsp


Put your custom message in not-found.jsp. 

HTH - MOD


--- Lee W <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have just started learning JSP & Tomcat so please
> be gentle.
> 
> I am currently designing a webapp and was trying to
> get some custom 
> error pages working (currently just to handle 404,
> page cannot be 
> found).  However they don't seem to work in Internet
> Explorer.
> 
> All of the default Tomcat errors work fine and so do
> my custom ones when 
> viewed in Mozilla, however IE just displays the
> default Microsoft errors.
> 
> I though that maybe IE was using the HTTP return
> code in order to 
> determine which page was displayed so I try changing
> that code using (in 
> the custom error jsp page):
> 
>   response.setStatus() - with codes SC_OK,
> SC_MOVE_TEMPORARILY
> 
> All this ended up doing is was breaking Mozilla &
> causing the default 
> Tomcat errors to come back.
> 
> Searching though the achives someone posted a
> similar problem last year 
> but either the archive does not have the replies or
> no-one replied to 
> the poster.
> 
> Any help here would be appreciated.
> 
> Regards
> 
> Lee
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom error pages & Internet Explorer

2003-06-11 Thread Lee W
Michael Duffy wrote:

Hi Lee,

Do you have  tags in your web.xml?  You
can tell Tomcat to send 404 errors to a JSP of your
choosing by adding something like this to web.xml,
after  and before :

404
/not-found.jsp

Put your custom message in not-found.jsp. 

HTH - MOD


Hi Michael,

Yep I have got that stuff in web.xml.  I think I've figured out what the 
problem is although I am not sure if it is the best way to have done it.

When I was specifying the setStatus tag I was only using the variable 
name not the fully quantified package so therefore when I changed it to:

response.setStatus(
  javax.servlet.http.HttpServletResponseWrapper.SC_NOT_FOUND);
The page appears to work fine in both IE & Mozilla.

Do you think to is any OK was to have done it or could it cause problems ?

Regards

Lee

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Custom error pages & Internet Explorer

2003-06-11 Thread Lee W
What is going on with my typing today :-<

Do you think to is any OK was to have done it or could it cause problems ?

Should have read as:

Do you think is was OK to have done it like this or could it cause 
problems ?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Custom error pages & Internet Explorer

2003-06-11 Thread Michael Duffy

Nope, perfectly okay.

One other thing you might want to know: if your JSPs
use an error page, your servlet will have to set the
request attribute javax.servlet.jsp.jspException in
your doPost(), like this:

try
{
// useful stuff here
}
catch (Exception e)
{
servletContext.log(e.getMessage(), e);
request.setAttribute("javax.servlet.jsp.jspException",
e);
forwardTo = "/error.jsp";
RequestDispatcher rd =
request.getRequestDispatcher(forwardTo);
rd.forward(request, response);
}

I'm glad you found a solution to your problem. - MOD

--- Lee W <[EMAIL PROTECTED]> wrote:
> Michael Duffy wrote:
> 
> > Hi Lee,
> > 
> > Do you have  tags in your web.xml? 
> You
> > can tell Tomcat to send 404 errors to a JSP of
> your
> > choosing by adding something like this to web.xml,
> > after  and before :
> > 
> > 
> > 404
> > /not-found.jsp
> > 
> > 
> > Put your custom message in not-found.jsp. 
> > 
> > HTH - MOD
> > 
> > 
> 
> Hi Michael,
> 
> Yep I have got that stuff in web.xml.  I think I've
> figured out what the 
> problem is although I am not sure if it is the best
> way to have done it.
> 
> When I was specifying the setStatus tag I was only
> using the variable 
> name not the fully quantified package so therefore
> when I changed it to:
> 
>   response.setStatus(
>   
>
javax.servlet.http.HttpServletResponseWrapper.SC_NOT_FOUND);
> 
> The page appears to work fine in both IE & Mozilla.
> 
> Do you think to is any OK was to have done it or
> could it cause problems ?
> 
> Regards
> 
> Lee
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Error on startup when using custom error pages

2002-07-02 Thread Sefton, Adam

Hi,

I'm trying to pick up error codes and display custom error pages. The one I'm working 
with currently is the 401 error in the case of failed logins. I've added the following 
in my /conf/web.xml:


401
error.html


and I have error.html in the conf directory.

When I try to start the Tomcat server, I get the following errors:

ERROR reading java.io.FileInputStream@e06940
At Line 849 /web-app/error-page/ 

ERROR reading java.io.FileInputStream@90c06f
At Line 849 /web-app/error-page/ 

ERROR reading java.io.FileInputStream@766806
At Line 849 /web-app/error-page/ 

ERROR reading java.io.FileInputStream@c623af
At Line 849 /web-app/error-page/ 

Does anyone have any ideas? I recall reading somewhere that the custom error setup 
with TOmcat was quite buggy, is this the problem?

I am using Tomcat 4.0.3 standalone on Win2k

Cheers

Adam


**
This message may contain information which is confidential or privileged.
If you are not the intended recipient, please advise the sender immediately
by reply e-mail and delete this message and any attachments
without retaining a copy.  

**


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Error on startup when using custom error pages

2002-07-02 Thread Sefton, Adam

Actually, I've managed to answer my own question - the  path needs to be 
from the web root of Tomcat. Now its working fine, but with an interesting problem.
Http Status 401 actually just means that authentication is required, which means that 
the site is automatically redirecting to the error page before asking for 
authentication ... is there any way of solving this? Or is it time I accepted I should 
be using FORM authentication rather than BASIC???

Cheers all
Adam

-Original Message-
From: Sefton, Adam [mailto:[EMAIL PROTECTED]]
Sent: 02 July 2002 16:39
To: 'Tomcat Users List'
Subject: Error on startup when using custom error pages


Hi,

I'm trying to pick up error codes and display custom error pages. The one I'm working 
with currently is the 401 error in the case of failed logins. I've added the following 
in my /conf/web.xml:


401
error.html


and I have error.html in the conf directory.

When I try to start the Tomcat server, I get the following errors:

ERROR reading java.io.FileInputStream@e06940
At Line 849 /web-app/error-page/ 

ERROR reading java.io.FileInputStream@90c06f
At Line 849 /web-app/error-page/ 

ERROR reading java.io.FileInputStream@766806
At Line 849 /web-app/error-page/ 

ERROR reading java.io.FileInputStream@c623af
At Line 849 /web-app/error-page/ 

Does anyone have any ideas? I recall reading somewhere that the custom error setup 
with TOmcat was quite buggy, is this the problem?

I am using Tomcat 4.0.3 standalone on Win2k

Cheers

Adam


**
This message may contain information which is confidential or privileged.
If you are not the intended recipient, please advise the sender immediately
by reply e-mail and delete this message and any attachments
without retaining a copy.  

**


--
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]>