use of org.apache.tapestry5.services.ComponentEventRequestParameters in project tapestry-5 by apache.
the class TapestryModule method contributeComponentEventRequestHandler.
/**
* Contributes filters:
* <dl>
* <dt>Ajax</dt>
* <dd>Determines if the request is Ajax oriented, and redirects to an alternative handler if so</dd>
* <dt>Secure</dt>
* <dd>Sends a redirect if an non-secure request accesses a secure page</dd>
* </dl>
*/
public void contributeComponentEventRequestHandler(OrderedConfiguration<ComponentEventRequestFilter> configuration, final RequestSecurityManager requestSecurityManager, @Ajax ComponentEventRequestHandler ajaxHandler) {
ComponentEventRequestFilter secureFilter = new ComponentEventRequestFilter() {
public void handle(ComponentEventRequestParameters parameters, ComponentEventRequestHandler handler) throws IOException {
if (requestSecurityManager.checkForInsecureComponentEventRequest(parameters))
return;
handler.handle(parameters);
}
};
configuration.add("Secure", secureFilter);
configuration.add("Ajax", new AjaxFilter(request, ajaxHandler));
}
Aggregations