Package com.sun.jsftemplating.util.fileStreamer

Examples of com.sun.jsftemplating.util.fileStreamer.Context


  // Create dummy UIViewRoot
  UIViewRoot root = new UIViewRoot();
  root.setRenderKitId("dummy");

  // Setup the FacesStreamerContext
  Context fsContext = new FacesStreamerContext(context);
  fsContext.setAttribute(Context.FILE_PATH, path);

  // Get the HttpServletResponse
  Object obj = context.getExternalContext().getResponse();
  HttpServletResponse resp = null;
  if (obj instanceof HttpServletResponse) {
      resp = (HttpServletResponse) obj;

      // We have an HttpServlet response, do some extra stuff...
      // Check the last modified time to see if we need to serve the resource
      long mod = fsContext.getContentSource().getLastModified(fsContext);
      if (mod != -1) {
    long ifModifiedSince = ((HttpServletRequest)
      context.getExternalContext().getRequest()).
      getDateHeader("If-Modified-Since");
    // Round down to the nearest second for a proper compare
View Full Code Here

TOP

Related Classes of com.sun.jsftemplating.util.fileStreamer.Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.