use of com.github.bordertech.wcomponents.container.WWindowInterceptor in project wcomponents by BorderTech.
the class ServletUtil method createInterceptorChain.
/**
* Creates a new interceptor chain to handle the given request.
*
* @param request the request to handle
* @return a new interceptor chain for the request.
*/
public static InterceptorComponent createInterceptorChain(final HttpServletRequest request) {
// Allow for multi part parameters
Map<String, String[]> parameters = getRequestParameters(request);
InterceptorComponent[] chain;
if (parameters.get(WServlet.DATA_LIST_PARAM_NAME) != null) {
// Datalist
chain = new InterceptorComponent[] { new TransformXMLInterceptor(), new DataListInterceptor() };
} else if (parameters.get(WServlet.AJAX_TRIGGER_PARAM_NAME) != null) {
// AJAX
chain = new InterceptorComponent[] { new TemplateRenderInterceptor(), new TransformXMLInterceptor(), new ValidateXMLInterceptor(), new AjaxErrorInterceptor(), new SessionTokenAjaxInterceptor(), new ResponseCacheInterceptor(CacheType.NO_CACHE), new UIContextDumpInterceptor(), new AjaxSetupInterceptor(), new WWindowInterceptor(true), new WrongStepAjaxInterceptor(), new ContextCleanupInterceptor(), new WhitespaceFilterInterceptor(), new SubordinateControlInterceptor(), new AjaxPageShellInterceptor(), new AjaxDebugStructureInterceptor(), new AjaxInterceptor() };
} else if (parameters.get(WServlet.TARGET_ID_PARAM_NAME) != null) {
// Targetted Content
chain = new InterceptorComponent[] { new TargetableErrorInterceptor(), new SessionTokenContentInterceptor(), new UIContextDumpInterceptor(), new TargetableInterceptor(), new WWindowInterceptor(false), new WrongStepContentInterceptor() };
} else {
chain = new InterceptorComponent[] { // Page submit
new TemplateRenderInterceptor(), new TransformXMLInterceptor(), new ValidateXMLInterceptor(), new SessionTokenInterceptor(), new ResponseCacheInterceptor(CacheType.NO_CACHE), new UIContextDumpInterceptor(), new WWindowInterceptor(true), new WrongStepServerInterceptor(), new AjaxCleanupInterceptor(), new ContextCleanupInterceptor(), new WhitespaceFilterInterceptor(), new SubordinateControlInterceptor(), new PageShellInterceptor(), new FormInterceptor(), new DebugStructureInterceptor() };
}
// Link the interceptors together in a chain.
for (int i = 0; i < chain.length - 1; i++) {
chain[i].setBackingComponent(chain[i + 1]);
}
// Return the top of the chain.
return chain[0];
}
Aggregations