package com.test.tomcat;
public class Constants {
public static class Context {
public static class Default {
public static final String Name = "default";
public static final String Path = "";
}
}
}
package com.test.tomcat;
public class ContextManager {
public void removeContext(String name) {
String test0 = Constants.Context.Default.Name; //1.
String test1 = com.test.tomcat.Constants.Context.Default.Name; //2.
Class test2 = com.test.tomcat.Constants.Context.Default.class; //3.
}
}
package com.test.tomcat2;
import com.test.tomcat.*;
public class ContextManager {
public void removeContext(String name)
{
String test0 = Constants.Context.Default.Name; //1.
String test1 = com.test.tomcat.Constants.Context.Default.Name; //2.
Class test2 = com.test.tomcat.Constants.Context.Default.class; //3.
}
}
1. No problems.
2. Problem/Error: The field named Context for type named
com.test.tomcat.Constants is not defined.
3. No problems. Calling getFields() of test2 i get both fields Name and
Path.
--
Jürgen King AlturaTec Informationssysteme GmbH
Tel: +49(0)7422/94004-110 Schrambergerstr. 21
Diplom Informatiker (FH) Fax: +49(0)7422/94004-100 78730 Lauterbach
Geschaeftsfuehrer j.k...@alturatec.de www.alturatec.de