Let's assume a typical
Java web application, with a data entry
jsp, a query jsp, and an output jsp, together with some kind of query Bean that transfers parameter values between these jsp's and the business objects. Let's assume that the list of parameters passed to and from these pages and objects remains the same. A book ordering catalogue page might, for example, use parameters such as author, title, publisher, year of publication, etc.
Is there any way I could bundle these parameter names in a single configuration file so they could be loaded at server startup time by all of these pages and by the query bean? Otherwise, as we all know, add one parameter and we can look forward to making changes to each and every page, and to the query bean...something I don't want to do.
I suppose I could use an init-param, but somehow that does not seem best; it would be better to bundle these business-level params together and differentiate them from server intialization parameters, etc.
Servlet params are on the other hand too narrow. I would want all the pages and the bean to have access to them.
I suppose some kind of singleton context bean might work...but I bet there's a handier solution.
Any ideas?
[ October 07, 2006: Message edited by: Bear Bibeault ]