Package org.focusns.common.web.page.engine.widget

Examples of org.focusns.common.web.page.engine.widget.WidgetResponse


    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        //
        if (request instanceof WidgetRequest && response instanceof WidgetResponse) {
            WidgetRequest widgetRequest = (WidgetRequest) request;
            WidgetResponse widgetResponse = (WidgetResponse) response;
            //
            if ("render".equals(widgetRequest.getRequestType())) {
                WidgetConfig widgetConfig = widgetRequest.getWidgetConfig();
                WidgetResponse cachedWidgetResponse = (WidgetResponse) widgetCache.get(widgetConfig);
                if (cachedWidgetResponse != null) {
                    FileCopyUtils.copy(cachedWidgetResponse.getResponseAsByteArray(), widgetResponse.getOutputStream());
                    return false;
                }
            }
        }
        return true;
View Full Code Here


    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
            throws Exception {
        //
        if (request instanceof WidgetRequest && response instanceof WidgetResponse) {
            WidgetRequest widgetRequest = (WidgetRequest) request;
            WidgetResponse widgetResponse = (WidgetResponse) response;
            //
            if ("render".equals(widgetRequest.getRequestType())) {
                WidgetConfig widgetConfig = widgetRequest.getWidgetConfig();
                if (widgetConfig.getCache() > 0) {
                    widgetCache.put(widgetConfig, widgetResponse);
View Full Code Here

TOP

Related Classes of org.focusns.common.web.page.engine.widget.WidgetResponse

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.