Allistair Crossley wrote:
> you should be acquiring your config params in the way I show, and then > setting them perhaps in the application scope, or maybe a registry, or > whatever pattern you wish. but do not make your "normal" classes > attempt to access any objects like servletconfig or otherise as that > breaks good design.
In my opinion configuration classes should be static, just reading a configuration file from the system in a static environment. That makes it difficult to set parameters from the .jsp-pages or servlets.
VAN DER MARLIERE FREDERIC wrote:
> Hi Andreas.
>
> You can get you parameter with:
>
>'request.getSession().getServletContext().getInitParameter("CONFIGFILE")'
>
> It first gets a reference on your application context and then gets
> the parameter you wrote in <context-param>...</context-param>Again, this all depends on a jsp-page. Perhaps the way to go is to have the config class nostatic and in the application scope.
What is "best practise"?
-- Andreas Andersson IT Dept. Travelstart Nordic [EMAIL PROTECTED] http://www.travelstart.se
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
