tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: GlobalNamingResources outside of server.xml
Date Wed, 22 Apr 2009 08:25:46 GMT
Robert Koberg wrote:
> 
> On Apr 21, 2009, at 7:02 PM, André Warnier wrote:
> 
>> André Warnier wrote:
>>> Mark Thomas wrote:
>>>> André Warnier wrote:
>>>>> Mark Thomas wrote:
>>>>>> Anthony J. Biacco wrote:
>>>>>>> I did end up trying it and it did work, I just didn't know if
it was
>>>>>>> something that's frowned upon, or would for whatever reason was
>>>>>>> planned to be phased out/deprecated.
>>>>>> Nope. That is absolutely fine. I know of a number of large 
>>>>>> corporations
>>>>>> that use that feature extensively. We get it essentially for free

>>>>>> with
>>>>>> the xml parser so it is going to stay.
>>>>>>
>>>>> My ears just kind of popped up on this thread.
>>>>> Would not the same kind of subterfuge be applicable for the case where
>>>>> you send an updated app as a war-file to a customer (thus including 
>>>>> its
>>>>> web.xml), but this customer has his own different parameters to set in
>>>>> the web.xml ?
>>>>
>>>> Hmm. Never tried it. I'd try it and let us know how you get on.
>>>>
>>> Hmm back.  Unfortunately, I'm not really a productive Java/Tomcat 
>>> programmer, and I don't do this kind of thing often (I mean prepare 
>>> applications as wars, deploy them etc..).
>>> What I mean is that if someone else would a quick easy way to test 
>>> this and be willing to do it, I am sure it would be much faster, and 
>>> lots of people would probably be interested in the answer.
>>> I've seen this subject come up here a few times.
>> I'll add that if it works, I think it's worth a Wiki article, and 
>> that, I am willing (and competent) to write.  To each his own..
> 
> It is simply XML (the example in this thread uses entities). You could 
> also use XInclude, which let's you define a fallback. And with either 
> entities or XInclude you can use XML Catalogs for a great deal of 
> flexibility.
> 
> If you have no preference, tend to prefer XInclude over entities.
> 

Allright, but I'm afraid this is still somewhat flying over my head, 
what we me not being /either/ a Java expert, /nor/ a Tomcat expert, 
/nor/ an XML expert. (What am I then doing on this list, one might ask).

So, since everyone but me seems to know pretty well how to do it, 
sometimes even in several ways, and since from previous threads I 
believe there is more interest for this, would it be possible for 
someone to give an effective simple example (or maybe two or three) 
based for example on this :

<?xml version="1.0"?>
<!DOCTYPE web-app
     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
   <display-name>MyApp</display-name>
   <description>
     My simple webapp.
   </description>

   <servlet>
     <servlet-name>MyServlet</servlet-name>
     <servlet-class>my.servlet</servlet-class>
     <init-param>
	<param-name>someParam</param-name>
	<param-value>someValue</param-value>
     </init-param>
     <load-on-startup>1</load-on-startup>
   </servlet>
...
</web-app>

of how one could make it so that the <param-value> of the above 
<param-name> "someParam" is a reference to some value defined elsewhere, 
for example in a file in the Tomcat "conf" directory ?




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


Mime
View raw message