Example #1
0
 /** Returns whether the page can be directly included. */
 private static boolean isDirectInclude(ClassWebResource cwr, String path) {
   final String ext = Servlets.getExtension(path);
   final Extendlet extlet = ext != null ? cwr.getExtendlet(ext) : null;
   if (extlet != null) {
     try {
       return extlet.getFeature(Extendlet.ALLOW_DIRECT_INCLUDE);
     } catch (Throwable ex) { // backward compatibility
     }
   }
   return true;
 }
Example #2
0
 // -- super --//
 protected long getLastModified(HttpServletRequest request) {
   final String pi = Https.getThisPathInfo(request);
   if (pi != null
       && pi.startsWith(ClassWebResource.PATH_PREFIX)
       && pi.indexOf('*') < 0 // language independent
       && !Servlets.isIncluded(request)) {
     // If a resource extension is registered for the extension,
     // we assume the content is dynamic
     final String ext = Servlets.getExtension(pi, false);
     if (ext == null || getClassWebResource().getExtendlet(ext) == null) {
       if (_lastModified == 0) _lastModified = new Date().getTime();
       // Hard to know when it is modified, so cheat it..
       return _lastModified;
     }
   }
   return -1;
 }
Example #3
0
 private static boolean shallSession(ClassWebResource cwr, String pi) {
   return cwr.getExtendlet(Servlets.getExtension(pi, false)) != null
       || (pi != null && pi.indexOf('*') >= 0);
   // Optimize the access of static resources (for GAE)
 }