/** {@inheritDoc} */ public void include(String path) throws IOException { context.include(path); }
/** {@inheritDoc} */ public void dispatch(String path) throws IOException { context.dispatch(path); }
/** {@inheritDoc} */ public ApplicationContext getApplicationContext() { return context.getApplicationContext(); }
/** {@inheritDoc} */ public List<String> getAvailableScopes() { return context.getAvailableScopes(); }
/** {@inheritDoc} */ public Map<String, String[]> getParamValues() { return context.getParamValues(); }
/** {@inheritDoc} */ public Map<String, String> getHeader() { return context.getHeader(); }
/** {@inheritDoc} */ public Map<String, String[]> getHeaderValues() { return context.getHeaderValues(); }
/** {@inheritDoc} */ public Map<String, Object> getContext(String scope) { return context.getContext(scope); }
/** {@inheritDoc} */ public OutputStream getOutputStream() throws IOException { return context.getOutputStream(); }
/** {@inheritDoc} */ public Map<String, String> getParam() { return context.getParam(); }
/** * Includes the result. By default, uses the wrapped request for the inclusion. * * @param path The path whose result will be included. * @throws IOException If something goes wrong. */ protected void doInclude(String path) throws IOException { getWrappedRequest().include(path); } }
/** {@inheritDoc} */ @Override public void render(String path, Request request) throws IOException { if (path == null) { throw new CannotRenderException("Cannot dispatch a null path"); } DispatchRequest dispatchRequest = getDispatchRequest(request); if (dispatchRequest == null) { throw new CannotRenderException("Cannot dispatch outside of a web environment"); } dispatchRequest.dispatch(path); }
/** {@inheritDoc} */ @Override public void execute(Request tilesContext, AttributeContext attributeContext) { if (tilesContext instanceof DispatchRequest) { try { ((DispatchRequest) tilesContext).include(url); } catch (IOException e) { throw new PreparerException("The inclusion of the URL " + url + " threw an I/O exception", e); } } else { throw new PreparerException("This preparer is restricted to web environments"); } } }