I have the following jsp error page, which is invoked when a certain type of exception is thrown.
The page is being invoked correctly, however, the problem i am facing is that the "<fmt:message key="application.title" />" tag is not wking as it is supposed to do. Instead of dispalying the title of my application, it displays "???application.title???". I made sure that the message key "application.title" is in my message bundle, so this cannot be the cause of this problem.
Bear Bibeault wrote:How does the page know anything about your message bundle?
This is a good point. My message bundle is declared in my Spring xml config, so Spring takes care of finding the correct messages. However, the error page is directly declared in the web.xml, without any interference of Spring, so this is probably the cause of the messages not being found. Should i declare my message bundle in the error page? If so, what is the correct syntax for declaring a message bundle?
However, nothing is being displayed (not even the ???applcation.title??? or ???error.system???). Inside my war files at the root of the WEB-INF dir there is a messages.properties file, so the message bundle should be found.
posted 10 years ago
I am kinda stuck on this one, so any help is much appreciated.
So far i've established that somehow i need to declare my message bundle and i have tried several options for doing this. I used <fmt:setBundle /> tag to declare the message bundle for the whole page, i enclosed my <fmt:message /> into an <fmt:bundle /> tag, but both did not have any result. Is there something that i have to declare in my web.xml before i can use the message bundle? I am under the impression that just declaring the bundle in the jsp is enough. Could someone give me a hint or pointer on where to look?