This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Global Exception handling issue in Struts2

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on struts2 app. I have configured few global exceptions (500, 404, java.io.FileNotFoundException,java.io.IOException) in web.xml file.
It is working fine in Mozilla browser but in other browsers it is not working i.e. chrome,Internet Explorer 8,9 etc. Here it is showing "The website cannot display the page" for 500 error.

Also i will appreciate if any one can provide any link to explore global exception in struts 2.
Any help is highly appreciable

Thanks in Advance
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add these lines in struts.xml

<global-results>
<result name="exception">jsp/common/error.jsp</result>
</global-results>

<global-exception-mappings>
<exception-mapping exception="java.lang.Exception"
result="exception" />
</global-exception-mappings>

 
leo jacob
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mohana Rao wrote:Add these lines in struts.xml

<global-results>
<result name="exception">jsp/common/error.jsp</result>
</global-results>

<global-exception-mappings>
<exception-mapping exception="java.lang.Exception"
result="exception" />
</global-exception-mappings>




Thanks Mahana!

I have done the same but still i am facing the same issue.
 
I promise I will be the best, most loyal friend ever! All for 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
    Bookmark Topic Watch Topic
  • New Topic