Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Error page configured in web.xml not working

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Greenhorn
Posts: 19
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 John
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 John
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic