• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error page configured in web.xml not working

 
vipul bondugula
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I configured error pages in web.xml file with error codes and exception types.
This is my web.xml file




I intentionally renamed a file to get FileNotFoundException ,to invoke corresponding errorhandler.

I am getting a blank page with message:



OracleJSP: java.io.FileNotFoundException: (The system cannot find the file specified.
)

I am using Jdeveloper tool,OC4J Server,Struts application


Please guide me where iam making mistake.

Thanks & Regards,
Vipul Kumar.

 
vibhor sharma
Greenhorn
Posts: 19
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my guess :

You are using version 2.3 of web.xml file , which is not only rarely used now but also order of entries matters in version 2.3.

Check if you are using any JSP expression language , because version 2.3 doesn't support EL.

change your web.xml which could support at least version 2.4 , may be it could work for you.

 
vipul bondugula
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vibhor,

Thanks For your Reply.

You are using version 2.3 of web.xml file , which is not only rarely used now but also order of entries matters in version 2.3.


I have checked order of entries.They are perfectly matching with the specification.


Check if you are using any JSP expression language , because version 2.3 doesn't support EL.


Iam not using any EL.Jst simple jsp's and application is struts web application...
I cant change the version as it is preferred by the client,,....

If there is any other way ,please guide me....


Thanks & Regards
Vipul Kumar.

 
vipul bondugula
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using version 2.3 of web.xml file , which is not only rarely used now but also order of entries matters in version 2.3.


Thanks Vibhor. Now configuration is working.order of entities is proper but a slight mistake in the positioning.
I don't know whethe it is the mistake or not.but when i change a little of my web.xml ,error pages are working.

May be this will be help full to other.I am posting the code what i have changed.

previous version of web.xml:-
<error-page>
<error-code>400</error-code>
<location>/errorhandler</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/errorhandler</location>
</error-page>
<error-page>
<error-code>500 </error-code>
<location>/errorhandler</location>
</error-page>

Above configuration did not work.


Current version of web.xml:-
<error-page>
<error-code>
400
</error-code>
<location>/errorhandler</location>
</error-page>
<error-page>
<error-code>
404
</error-code>
<location>/errorhandler</location>
</error-page>
<error-page>
<error-code>
500
</error-code>
<location>/errorhandler</location>
</error-page>

This configuration is working fine..

and one more remaining is exception-type tag..i kept java.lang.Throwable in exception-type tag in web.xml file.

This is not working.can any one having any suggestions for this .Any help is accepted...!


Thanks & Regards,
Vipul Kumar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic