return EVAL_PAGE;
}
//
StringBuffer buffer = new StringBuffer();
for(WidgetConfig widgetConfig : widgetConfigList) {
WidgetCacheService cacheService = getWidgetCacheService();
Object value = cacheService.get(widgetConfig);
//
if(StringUtils.isBlank(widgetConfig.getCache()) || value==null) {
pageContext.getRequest().setAttribute(WidgetConfig.KEY, widgetConfig);
pageContext.getRequest().setAttribute(WidgetConfig.NAME, widgetConfig);
try {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
final HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
pageContext.getRequest().getRequestDispatcher(widgetConfig.getPath())
.include(request, new GenericResponseWrapper(response, baos));
//
value = (baos.toString("UTF-8"));
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
pageContext.getRequest().removeAttribute(WidgetConfig.NAME);
pageContext.getRequest().removeAttribute(WidgetConfig.KEY);
}
//
if(StringUtils.isNotBlank(widgetConfig.getCache())) {
cacheService.put(widgetConfig, value);
}
//
if(StringUtils.isNotBlank((String) value)) {
buffer.append((String) value);
}