struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <>
Subject [OT] Exception.getLocalizedMessage()
Date Sun, 23 Dec 2007 00:34:39 GMT
I came across a conundrum while implementing the S2 exception handling that we 
were discussing in another thread.

As the title suggests, I'm interested in Exception.getLocalizedMessage() but 
have a seemingly intractable problem with it.

Exception.getLocalizedMessage() returns by default the message in getMessage() 
but is put there by Sun and the Java creators as a useful method that we coders 
can override in our Exception child classes with our own method that localizes 
the exception message.

The problem is, my exceptions mostly live in my business model module. However, 
to localize the exception message, the exception needs access to a Resource 
bundle which are all front-end artifacts that I don't want in my business model 

Also I don't want a dependency from my business model onto the front-end.

And of course, I can't pass in parameters when calling getLocalizedMessage().

So what's the score here? Is getLocalizedMessage() dead in the water, or is 
there another way that's not overcomplicated?

Is there anybody actually implementing getLocalizedMessage() on their exceptions?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message