This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
albert kao wrote:Only a type can be imported. com.myutil resolves to a package KeyClient.java /XX/src/com/myutil/taglib line 9 Java Problem
The error message could be more clear, true. With imports you must either specify a class (e.g. java.util.List) or use a wildcard to import everything from the package (e.g. java.util.*). The former is preferred as it also avoids ambiguity (like java.awt.List and java.util.List when importing java.awt.* and java.util.*).
The method getTestKey(String) is undefined for the type KeyClient KeyClient.java /XX/src/com/myutil/taglib line 80 Java Problem
The getTextKey method is a static method of class GetTestKey. You are calling it directly so the compiler looks for the method in the current class (KeyClient). For instance methods you must use an instance to call a method (instance.instanceMethod(params)); for static methods you should use the class name (MyClass.staticMethod(params)).