• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Defining error page

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to redirect to different page whenever I get 404 error, I defined error-page in web.xml but still it doesn't redirect to specified page.Can someone please help me on this
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check whether your web.xml is valid ( conforms to the DTD) because even if there is an error most servers deploy the web app and ignore the errors
 
kavitha rama
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response but I checked it, it conforms to dtd standards. Code is as follows
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
Please help me
 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using weblogic?
 
kavitha rama
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using Oracle 9iAS
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the error page will not be invoked unless the void sendError(404) method is invoked. The error code did not work in weblogic 7.0 as well.
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is old thread regarding the same problem but in weblogic, in which I participated
https://coderanch.com/t/65681/BEA-Weblogic/web-xml-error-page
 
kavitha rama
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your immediate response. Yes i gone through the link, but my problem is slightly different. I tried on netscape 7.02 and that works fine, I mean invokes error page with out adding anything. But IE doesn't, if I add response.setErrorCode(404), then it works. So, how to proceed further I don't follow
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be you can post your problem here
http://www.oracle.com/forums/index.jsp
 
kavitha rama
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks pradeep for your immediate responses and guidence.Can you please tell me what other forums are available for posting java questions as I am new.
We are using oracle 9iAS with oc4j container. I have defined error-page for redirecting 404 error-code in web.xml. It works fine with all browsers except internet explorer 5.5 and higher, IE ignores and displays 'page cannot be displayed' page. Can anybody help me on this, but on the otherhandm if I send response.sendError(404);, it recognizes and invokes page.
Thanks fo advice
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the OC4J forum in oracle site
http://www.oracle.com/forums/forum.jsp?forum=46
I am sorry I cannot help you to solve the problem you are facing.
 
kavitha rama
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted question in that forum as you suggested. Thanks for the help
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dont forget to post your results here.
 
kavitha rama
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks pradeep. I got the solution in oc4j/j2ee forum. In MS IE, tools/internet options/Advanced, I turned off option 'show http error friendly messages'. Then it worked fine.
Thanks for the help
    Bookmark Topic Watch Topic
  • New Topic