Re: Configuration params for a webapp - best practice?



On 31/8/06 05:03, in article MPG.1f600d5ff65871c29896e6@xxxxxxxxxxxxxxxx,
"Chris Smith" <cdsmith@xxxxxxx> wrote:

Steve <root@xxxxxxxxx> wrote:
Where is the best place to configure this path so it's not hard coded in the
web app and is easy to configure when the app is deployed?

The right way to do this is to put the information in a context
initialization parameter. From any servlet, you can access this
information from the ServletContext object. You can put a default value
into web.xml, and then the servlet container will provide a mechanism to
configure the parameter for a particular deployment (for example, in
Tomcat, you'd use server.xml in the conf/ directory).

Thanks Chris.

--
Regards,
Steve

"...which means he created the heaven and the earth... in the DARK! How good
is that?"

.



Relevant Pages

  • Re: Configuration params for a webapp - best practice?
    ... web app and is easy to configure when the app is deployed? ... initialization parameter. ... From any servlet, you can access this ... configure the parameter for a particular deployment (for example, ...
    (comp.lang.java.programmer)
  • Re: Default servlet and images/css/...
    ... > I want to make a web app that would use a default servlet. ... > set it I can't access images, css, etc. ... > would have human-readable URLs? ...
    (comp.lang.java.programmer)
  • Re: Struts1.1, subclassing controller servlet
    ... > I'm using a subclass of the standard controller servlet class ... > in my Struts1.1 web app. ... > when loading the servlet. ... subclass and are using something other than Digester, ...
    (comp.lang.java.programmer)
  • Re: servlet annotations for URL mapping?
    ... file in the webapp to see if it's annotated as a servlet? ... descriptor-free deployment of EJBs and mapped entities respectively; ... Looking at the servlet 2.5 spec, I don't see any annotations mentioned ... @Stateful, @Local, and @Remote are used to control EJB deployment). ...
    (comp.lang.java.programmer)
  • Struts1.1, subclassing controller servlet
    ... I'm using a subclass of the standard controller servlet class ... I have to include the commons digester library in my web app ... How can I avoid ...
    (comp.lang.java.programmer)