Package cssvar

Examples of cssvar.CSSVarContext


  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    ServletContext ctx = req.getSession().getServletContext();

    CSSVarContext globalCSSContext = (CSSVarContext) ctx
        .getAttribute(GLOBAL_CONTEXT_KEY);

    resp.setContentType("text/css");

    String targetFilepath = getTargetFilePath(req);
View Full Code Here


    File defaultConfig = new File(ctx.getRealPath(DEFAULT_CONFIG_PATH));

    LOG.info("Loading global CSSVar context");
    try {
      ctx.setAttribute(CSSVarServlet.GLOBAL_CONTEXT_KEY,
          new CSSVarContext(defaultConfig));
    } catch (Exception e) {
      LOG.warn("Unable to load default config file \""
          + DEFAULT_CONFIG_PATH
          + "\". CSS files will start with an empty global var context.");
    }
View Full Code Here

    File targetFile = new File(getTargetFilePath(req));
    long cssModified = targetFile.exists() ? targetFile.lastModified()
        : currTime;

    ServletContext ctx = req.getSession().getServletContext();
    CSSVarContext globalCSSContext = (CSSVarContext) ctx
        .getAttribute(GLOBAL_CONTEXT_KEY);
    long cssvarContextModified = globalCSSContext != null ? globalCSSContext
        .getLastInit() : currTime;

    return Math.max(cssModified, cssvarContextModified);
  }
View Full Code Here

TOP

Related Classes of cssvar.CSSVarContext

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.