Imports all classes from a package so they can be referenced by their simple names in EL expressions. Classes from the imported package are resolved during expression evaluation. If a simple name is ambiguous across multiple imported packages, an ELException is thrown at resolution time. @p
(String name)
| 401 | * @param name the package name to import |
| 402 | */ |
| 403 | public void importPackage(String name) { |
| 404 | // Import ambiguity is handled at resolution, not at import |
| 405 | // Whether the package exists is not checked, |
| 406 | // a) for sake of performance when used in JSPs (BZ 57142), |
| 407 | // b) java.lang.Package.getPackage(name) is not reliable (BZ 57574), |
| 408 | // c) such check is not required by specification. |
| 409 | Set<String> preloaded = standardPackages.get(name); |
| 410 | packageNames.put(name, Objects.requireNonNullElse(preloaded, Collections.emptySet())); |
| 411 | } |
| 412 | |
| 413 | |
| 414 | /** |