Package org.broadleafcommerce.common.web.resource

Examples of org.broadleafcommerce.common.web.resource.BroadleafResourceHttpRequestHandler


     * @param arguments
     * @return the "blJsResources" bean
     */
    public static BroadleafResourceHttpRequestHandler getJsRequestHandler(Arguments arguments) {
        String key = "blJsResources";
        BroadleafResourceHttpRequestHandler reqHandler = (BroadleafResourceHttpRequestHandler) cachedBeans.get(key);
        if (reqHandler == null) {
            final ApplicationContext appCtx = ((SpringWebContext) arguments.getContext()).getApplicationContext();
            reqHandler = (BroadleafResourceHttpRequestHandler) appCtx.getBean(key);
            cachedBeans.put(key, reqHandler);
        }
View Full Code Here


     * @param arguments
     * @return the "blCssResources" bean
     */
    public static BroadleafResourceHttpRequestHandler getCssRequestHandler(Arguments arguments) {
        String key = "blCssResources";
        BroadleafResourceHttpRequestHandler reqHandler = (BroadleafResourceHttpRequestHandler) cachedBeans.get(key);
        if (reqHandler == null) {
            final ApplicationContext appCtx = ((SpringWebContext) arguments.getContext()).getApplicationContext();
            reqHandler = (BroadleafResourceHttpRequestHandler) appCtx.getBean(key);
            cachedBeans.put(key, reqHandler);
        }
View Full Code Here

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws ServletException {
        if (BroadleafResourceHttpRequestHandler.class.isAssignableFrom(handler.getClass())) {
            // Bundle resources are cached for ten years
            BroadleafResourceHttpRequestHandler h = (BroadleafResourceHttpRequestHandler) handler;
            if (h.isBundleRequest(request)) {
                applyCacheSeconds(response, TEN_YEARS_SECONDS);
            }
            return true;
        } else if (ResourceHttpRequestHandler.class.isAssignableFrom(handler.getClass())) {
            // Non-bundle resources will not specify cache parameters - we will rely on the server responding
View Full Code Here

        }
       
        if (getBundleEnabled()) {
            String versionedBundle = bundlingService.getVersionedBundleName(name);
            if (StringUtils.isBlank(versionedBundle)) {
                BroadleafResourceHttpRequestHandler reqHandler = getRequestHandler(name, arguments);
                try {
                    versionedBundle = bundlingService.registerBundle(name, files, reqHandler);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
View Full Code Here

            throw new IllegalArgumentException("Unknown extension for: " + src + " - only .js and .css are supported");
        }
    }
   
    protected BroadleafResourceHttpRequestHandler getRequestHandler(String name, Arguments arguments) {
        BroadleafResourceHttpRequestHandler handler = null;
        if (name.endsWith(".js")) {
            handler = ProcessorUtils.getJsRequestHandler(arguments);
        } else if (name.endsWith(".css")) {
            handler = ProcessorUtils.getCssRequestHandler(arguments);
        }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.web.resource.BroadleafResourceHttpRequestHandler

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.