tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From QM <>
Subject Re: Declarative security in context?
Date Thu, 18 Nov 2004 00:30:33 GMT
On Wed, Nov 17, 2004 at 10:58:23PM +0100, Simon Tardell wrote:
: I want to deploy multiple instances of the same webapp, with different 
: authorization rules. However, declarative security is done in the 
: web.xml of which there will only be one copy (referred by multiple 
: contexts). Is it possible to impose security constraints on a web app 
: from the outside, i.e. declaring them in the context rather than in the 
: web.xml?  Ideally I'd like to be able to "shadow" parts of the web.xml 
: on a per context basis, but I can't see how to do that. Would I have to 
: write a valve to do custom authorization?

You may have an easier time using an automated build process (e.g. Ant)
that supports substitution rules in files, and creating separate webapps
for each set of security rules.

Pain in the rear?  Not really.
Wasteful of space? Perhaps, but perhaps not.
Portable across all containers?  Yes.

I forget the task off the top of my head, but I believe Ant's <copy>
task lets you feed a series of property-based replacement patterns to
the replacement engine.

For example, if the file has

	<.... port=@app.port_num@ ...>

and the property file defines

	app.port_num = 4000

Then the resultant (copied) file will have:

	<.... port=4000 ...>

Have one properties file per webapp, aka per set of security rules.



software  --
tech news --

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message