costin 01/02/08 23:49:10
Modified: src/share/org/apache/tomcat/modules/config
PolicyInterceptor.java ServerXmlReader.java
Log:
- small fix in ServerXmlReader
- canonical path in PolicyInterceptor
Revision Changes Path
1.7 +12 -4
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/PolicyInterceptor.java
Index: PolicyInterceptor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/PolicyInterceptor.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PolicyInterceptor.java 2001/02/01 05:18:56 1.6
+++ PolicyInterceptor.java 2001/02/09 07:49:09 1.7
@@ -106,11 +106,19 @@
if( System.getSecurityManager() != null ) return;
try {
if( null == System.getProperty("java.security.policy")) {
+ File f=null;
if( policyFile==null ) {
- // XXX ugly API - change CM
- File f= new File(cm.getHome(), "conf/tomcat.policy");
- policyFile=f.getPath();
- }
+ policyFile="conf/tomcat.policy";
+ }
+
+ if( FileUtil.isAbsolute(policyFile))
+ f=new File(policyFile);
+ else
+ f=new File(cm.getHome() + File.separator +
+ policyFile);
+ try {
+ policyFile=f.getCanonicalPath();
+ } catch(IOException ex ) {}
log("Setting policy file to " + policyFile);
System.setProperty("java.security.policy",
policyFile);
1.5 +7 -3
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ServerXmlReader.java
Index: ServerXmlReader.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ServerXmlReader.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ServerXmlReader.java 2001/02/06 06:45:05 1.4
+++ ServerXmlReader.java 2001/02/09 07:49:10 1.5
@@ -162,7 +162,7 @@
public static void setTagRules( XmlMapper xh ) {
xh.addRule( "module", new XmlAction() {
- public void end(SaxContext ctx ) throws Exception {
+ public void start(SaxContext ctx ) throws Exception {
Object elem=ctx.currentObject();
AttributeList attributes = ctx.getCurrentAttributes();
String name=attributes.getValue("name");
@@ -178,9 +178,12 @@
public static void addDefaultTags( ContextManager cm, XmlMapper xh)
throws TomcatException
{
+ if( cm.getNote( "modules" ) != null )
+ return;
File f=new File( cm.getHome(), "/conf/modules.xml");
if( f.exists() ) {
- cm.setNote( "configFile", f.getAbsoluteFile());
+ // cm.setNote( "configFile", f.getAbsoluteFile());
+ cm.setNote( "modules", new Hashtable());
loadConfigFile( xh, f, cm );
// load module-*.xml
Vector v = getUserConfigFiles(f);
@@ -195,7 +198,7 @@
// similar with ant's taskdef
public static void addTag( XmlMapper xh, String tag, String classN) {
xh.addRule( tag ,
- xh.objectCreate( null, classN ));
+ xh.objectCreate( classN, null ));
xh.addRule( tag ,
xh.setProperties());
xh.addRule( tag,
@@ -277,3 +280,4 @@
}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]