I am writing a web service in Java, and I am trying to figure out the best way to define error codes and their associated error strings. I need to have a nu
I'd recommend that you take a look at java.util.ResourceBundle. You should care about I18N, but it's worth it even if you don't. Externalizing the messages is a very good idea. I've found that it was useful to be able to give a spreadsheet to business folks that allowed them to put in the exact language they wanted to see. We wrote an Ant task to generate the .properties files at compile time. It makes I18N trivial.
If you're also using Spring, so much the better. Their MessageSource class is useful for these sorts of things.