Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Global Exception handling issue in Struts2

 
leo jacob
Greenhorn
Posts: 17
  • 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
 
Mohana Rao Sv
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: 17
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic