Resolving the Location of Java Types and Packages Referenced in JSP Files

When references are resolved to Java types from JPS files during verification, some references may not be resolved due to ambiguous names.

For example, Id.java in the app1 folder is registered as app1\com\company\Id.java and Id.java in the app2 folder is registered as app2\com\company\Id.java.

JSP cannot find the classes because there are now two possible definitions of the class com.company.Id in the workspace. If your JSP files reference this class, you need to specify which Java file defines the class in the Java Classpath field for the JSP file type in Project Options > Verification > Settings. Otherwise, the relationship between JSP and the class is marked as unresolved in the workspace.

Java Classpath contains a list of patterns used to resolve the location of Java types and packages referenced in JSP files. Each pattern describes the path to a Java file that defines the referenced type or package. In our case, the pattern might be app1\*, which matches any Java source file registered in the workspace from the app1 folder.

You can also match JAR files or external files referenced in Java applications but not registered in the workspace, as specified in the Enter classpath to JAR Files and/or path to external Java file root directories field for the Java file type in Workspace Options > Verification > Settings. The pattern *\jre6\lib\rt.jar would find the Java 6 run-time library, for example.

Right-click in the Java Classpath field and choose Add in the pop-up menu to enter a pattern. You can use asterisk symbol to match any sequence of characters.

Relationships that cannot be resolved by any of the specified patterns are marked as unresolved in the workspace. Once the classes are resolved, only the base name of the referenced class or package appears in the relationship (in the Repository Browser). Use the Unresolved Report in the Reference Reports window to see what is still unresolved and determine the patterns you need to add.