wood burning stoves 2.0*
The moose likes Servlets and the fly likes Error Page problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Error Page problem." Watch "Error Page problem." New topic
Author

Error Page problem.

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hi ranchers,

Got a problem while configuring a <error-page> element for my application. This is what i have done to configure an application wide error-page element.

1. In web.xml, provided an entry as follows :



2. within my webapps folder under my application TestApp created a folder named errorPages and a placed a new file called 404.jsp.

3. Inside 404.jsp, provided isErrorPage = "True"



But what i always get is plain old "Page cannot be found"

I have also restarted the tomcat server and have checked that when i click on a page which is not available, it does create a _404_jsp.java in the work folder of catalina home.

Can anyone please throw light what i am missing in the above steps to make this error-page handling work as i desire it to be.

Thanks in advance,
Yogendra N Joshi.


Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

What you're doing is correct. Is the 404.jsp put in the right place? It should be in the errorPages/404.jsp as shown in your web.xml.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Shashank Rudra
Ranch Hand

Joined: Mar 26, 2009
Posts: 131
With the entries similar to what you have in web.xml and other stuff also similar to what you are trying - I am able to see the error page(customized one) in Firefox. But still am unable to see the expected result in IE. I am using Tomcat5.0 and servlet2.4. Firefox3.0 IE 7.0

Would someone please tell what is happening here.


Programmer Analyst || J2EE web development/design
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

It's a browser setting in IE -- I forget which.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Bear Bibeault wrote:It's a browser setting in IE -- I forget which.


Bear, Can you please help with this, since i need to make this work and i have done everything correct as per my jsp/ servlets knowledge.

Regards,
Yogendra
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

I don't use IE -- I don't even use Windows -- so I can't check for you. Do some research.

But the point is, because it is a browser setting, you cannot affect it from a Servlet. You'll need to convince all your users to change their browser settings. Is that feasible?

One thing you might try: sometimes a longer error response will cause IE to use the error page instead of its own -- at least (if I'm recalling correctly) with older versions of IE.

(And please do not "bump" your topics in an effort to get more responses. I have removed your "bump".)
vivek Jain s
Greenhorn

Joined: Nov 23, 2010
Posts: 3
Yogendra Joshi wrote:
Bear Bibeault wrote:It's a browser setting in IE -- I forget which.


Bear, Can you please help with this, since i need to make this work and i have done everything correct as per my jsp/ servlets knowledge.

Regards,
Yogendra


Hi Yogendra,

I faced the same problem as you did. Error page was coming fine with Firefox but not with IE. Even after a tomcat restart, did not resove it.

But after 1 hour I restarted the server again and It is working fine in IE. I am using IE-6.
Check attachment also.

Regds
Vivek



[Thumbnail for error_page.JPG]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error Page problem.
 
Similar Threads
Problem in error-page tag
Not able to get the new page
problem while declaring error page
Having problem with error-page
Error page / web.xml