@Override
 public URL getResource(String path) throws MalformedURLException {
   if (Globals.IS_SECURITY_ENABLED) {
     try {
       return (URL) invokeMethod(context, "getResource", new Object[] {path});
     } catch (Throwable t) {
       if (t instanceof MalformedURLException) {
         throw (MalformedURLException) t;
       }
       return null;
     }
   } else {
     return context.getResource(path);
   }
 }