How to customize JBoss AS7 404 page

后端 未结 3 927
难免孤独
难免孤独 2020-12-16 23:47

I already created a custom 404 page inside my web app deployed in JBoss AS 7.1. So if my app is at fubar dot com :8080/Myapp and I go to fubar dot com :8080/Myapp/xyzzy, I

3条回答
  •  爱一瞬间的悲伤
    2020-12-17 00:20

    I believe you will have to create your own page. JBoss uses Tomcat for serving the web requests.

    In Tomcat the way to define your own 404 response page is having the following snippet in your web.xml (Ref - http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6)

        
            404
            /error/404.html
        
    

    A detailed page on how to do this with struts is created by mykong @ http://www.mkyong.com/struts/how-to-handle-404-error-in-struts/.

    If you are using any other framework than struts you should have a equivalent.

提交回复
热议问题