tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence M. Bandoian" <tere...@tmbsw.com>
Subject Re: accessing web.xml
Date Thu, 29 May 2008 18:40:34 GMT
Hi-

Another reasonable approach would be to set system properties either in
the startup script or in the Windows registry if you're running as a
service.

-Terence M. Bandoian


>>> Subject:
>>> Re: accessing web.xml
>>> From:
>>> Christopher Schultz <chris@christopherschultz.net>
>>> Date:
>>> Thu, 29 May 2008 11:14:44 -0400
>>> To:
>>> Tomcat Users List <users@tomcat.apache.org>
>>>
>>> To:
>>> Tomcat Users List <users@tomcat.apache.org>
>>>
>>> Message-ID:
>>> <483EC864.7010605@christopherschultz.net>
>>> MIME-Version:
>>> 1.0
>>> In-Reply-To:
>>> <001401c8c132$74961ea0$5c00a8c0@referentia.com>
>>> Content-Type:
>>> text/plain; charset=UTF-8; format=flowed
>>> Content-Transfer-Encoding:
>>> 7bit
>>>
>>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Chris,
>>>
>>> Chris Richmond wrote:
>>> | I have created a web service using JAX-WS and deployed my .war and
it runs
>>> | fine, but now I want to convert some hard-coded config values to read
>>> values
>>> | from the WEB-INF/web.xml file that was created/deployed.
>>>
>>> Sounds good.
>>>
>>> | I have addes something like the following to my web.xml:
>>> |
>>> |     <context-param>
>>> |         <description>test context param</description>
>>> |         <param-name>testParam</param-name>
>>> |         <param-value>my value</param-value>
>>> |     </context-param>
>>>
>>> Rest assured... this is a reasonable choice for configuring your webapp.
>>> There is a thread on this list right now where some folks are arguing
>>> over how best to do this (see thread "Best practice? configuration of a
>>> web application"). <context-params> in web.xml is as good as any
method IMO.
>>>
>>> | And I want to access it from any of my classes within my web service.
>>>
>>> Okay. What have you tried? What container objects do you have access to?
>>> Can you get to the request?
>>>
>>> | Perhaps I shouldn't be using <context-param> at all, but some other
>>> type of
>>> | entry in web.xml?  In either case, I can't seem to figure out how to
>>> locate
>>> | and use an entry like that from within any class in my JAX-WS web
>>> service.
>>>
>>> You could use <env-entry> instead, and then those settings would be
>>> available via JNDI (which you can get to from anywhere) instead of
>>> through the ServletContext (which you might not have available).
>>>
>>> - -chris


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message