JTraining Blog

Share your knowledge.
Bram
Bram

At the moment my project team and me are programming a Bank web application.

 


It is build using JBoss with JSF, and we are using JAAS for security reasons.
Since there can be many errors, a custom 404 error page can come in handy.
With JBoss, it isn’t all that difficult …  you just need to know how.

To do so ... edit your web.xml. You have to add this:
< web-app>
    ...
        < error-page>
            < error-code>404< /error-code>
            < location>/YourLocation/YourErrorPage.html< /location>
        < /error-page>
    ...
< /web-app>

Since much is done dynamically, you don’t have to define anything else but this.
(Of course you have to create your own error page)

As for complications:
I’m running Firefox and it all worked fine, but a member of my team is running Internet Explorer,
He got a “This webage cannot be found” message … after a little bit of googling, this was the trick:
Go to: Internet Options … Advanced Tab … and uncheck “Show friendly HTTP error messages”


Tagged in: Untagged 
Trackback(0)
Comments (2)Add Comment
svanhugten
...
written by svanhugten, January 29, 2010
This isn't exclusive to JBoss. This will work with any Java (EE) compliant web container, because it's part of the web standard.
Bram
...
written by Bram, February 09, 2010
Cheers Stephan smilies/cheesy.gif I did not know that

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.

busy

Tags:

Sponsers