Search in sources :

Example 6 with ComponentRequestHandler

use of org.apache.tapestry5.services.ComponentRequestHandler in project tapestry-5 by apache.

the class ProductionModeUnknownComponentFilter method handleComponentEvent.

@Override
public void handleComponentEvent(ComponentEventRequestParameters parameters, ComponentRequestHandler handler) throws IOException {
    Page containerPage = cache.get(parameters.getContainingPageName());
    try {
        containerPage.getComponentElementByNestedId(parameters.getNestedComponentId());
        handler.handleComponentEvent(parameters);
    } catch (UnknownValueException ex) {
        request.setAttribute(InternalConstants.REFERENCED_COMPONENT_NOT_FOUND, true);
    }
}
Also used : UnknownValueException(org.apache.tapestry5.commons.util.UnknownValueException) Page(org.apache.tapestry5.internal.structure.Page)

Aggregations

Dispatcher (org.apache.tapestry5.http.services.Dispatcher)5 Request (org.apache.tapestry5.http.services.Request)5 Response (org.apache.tapestry5.http.services.Response)5 ComponentClassResolver (org.apache.tapestry5.services.ComponentClassResolver)5 ComponentRequestHandler (org.apache.tapestry5.services.ComponentRequestHandler)5 LocalizationSetter (org.apache.tapestry5.services.LocalizationSetter)5 MetaDataLocator (org.apache.tapestry5.services.MetaDataLocator)5 EmptyEventContext (org.apache.tapestry5.internal.EmptyEventContext)4 ComponentEventRequestParameters (org.apache.tapestry5.services.ComponentEventRequestParameters)4 Test (org.testng.annotations.Test)4 URLEventContext (org.apache.tapestry5.internal.URLEventContext)2 ClientWhitelist (org.apache.tapestry5.services.security.ClientWhitelist)2 UnknownValueException (org.apache.tapestry5.commons.util.UnknownValueException)1 Page (org.apache.tapestry5.internal.structure.Page)1