aspose file tools*
The moose likes JSP and the fly likes Defining error page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Defining error page" Watch "Defining error page" New topic
Author

Defining error page

kavitha rama
Ranch Hand

Joined: Jun 18, 2003
Posts: 38
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
Satish Gopalakrishnan
Ranch Hand

Joined: Feb 13, 2001
Posts: 52
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

Joined: Jun 18, 2003
Posts: 38
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
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Are you using weblogic?


Groovy
kavitha rama
Ranch Hand

Joined: Jun 18, 2003
Posts: 38
We are using Oracle 9iAS
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

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

Joined: Feb 27, 2002
Posts: 8919

There is old thread regarding the same problem but in weblogic, in which I participated
http://www.coderanch.com/t/65681/BEA-Weblogic/web-xml-error-page
kavitha rama
Ranch Hand

Joined: Jun 18, 2003
Posts: 38
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

Joined: Feb 27, 2002
Posts: 8919

May be you can post your problem here
http://www.oracle.com/forums/index.jsp
kavitha rama
Ranch Hand

Joined: Jun 18, 2003
Posts: 38
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

Joined: Feb 27, 2002
Posts: 8919

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

Joined: Jun 18, 2003
Posts: 38
I posted question in that forum as you suggested. Thanks for the help
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Dont forget to post your results here.
kavitha rama
Ranch Hand

Joined: Jun 18, 2003
Posts: 38
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Defining error page