Struts Message Resources
Is there a way to determine in an Action Class whether a particular message key is available in a particular message bundle.
Eg how do you determine whether the key "tranx.amount" exits in bundle "user".
The idea is that if it does not existing, I can set a default key so that the JSP will always render with this default if something is amiss.
JJ
[374 byte] By [
JoeJess1a] at [2007-10-2 9:46:35]

There is a way..but its not a preffered method of doing it................
U need to get the file from the location where u have put the resource bundle and then put into properties util structure and check.....
there is no api in struts to get the resource bundle from action class i beleive........
regards
Shanu
If you use null="false" in the declaration of yuor MesageResources Struts will display ?tranx.amout? or something similar.
To actually test for a key you need something like
MessageResourrces.getResources().hasKey(yourkey)
I have seen the actual code while digging in the Struts source but i left it at work