It's not a secret anymore!*
The moose likes Tomcat and the fly likes Context.xml: how to reference parameter inside the same file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Context.xml: how to reference parameter inside the same file" Watch "Context.xml: how to reference parameter inside the same file" New topic
Author

Context.xml: how to reference parameter inside the same file

durbans oasoaksoak
Greenhorn

Joined: Jan 13, 2011
Posts: 1
I'd like to create a context.xml where I have:



where parameter1, parameter2 and parameter3 use the values of the parameters tag defined previously.

Is it possible ?

I didn't find any way or syntax to set name1, name2 and name3 as reference .
It seems that it accepts only strings.
Hun Jinxijn
Greenhorn

Joined: Apr 15, 2011
Posts: 1
I have a similar problem. Is it possible to do this? Is it even possible to define some value in server.xml or catalina.properties and use them in context.xml?

I have added the line



to catalina.properties.

Now I define a Realm in my webabb's context.xml:


However, in the logfiles I can find:
org.postgresql.util.PSQLException: FATAL: database "${DBVAL}" does not exist

It seems, that the parameter value was not replaced.

What I would like to have is to define a Realm once in context.xml, that will be used both on a development and on a productive server. The servers define the actual name of the database (here "mydb_dev"), e.g. in catalina.properties.
 
Don't get me started about those stupid light bulbs.
 
subject: Context.xml: how to reference parameter inside the same file
 
Similar Threads
Doubt in HashMap
Inner SQL
Refactoring a static method for use in a clustered environment(multiple threads)
About String
Event Handlers