* @param location The location
* @return The URL pointed to by the location
* @exception MalformedURLException If the location is malformed
*/
public URL getURL(String location) throws MalformedURLException {
Context envContext = null;
try {
envContext = (Context)this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
} catch (ContextException e){
getLogger().error("ContextException in getURL",e);
}
if (envContext == null) {
getLogger().warn("no environment-context in application context (making an absolute URL)");
return new URL(location);
}
URL u = envContext.getResource("/" + location);
if (u != null)
return u;
else {
getLogger().error(location + " could not be found. (possible context problem)");
throw new RuntimeException(location + " could not be found. (possible context problem)");