/** {@inheritDoc} */ public AttributeContext getAttributeContext(Request request) { AttributeContext context = getContext(request); if (context == null) { context = new BasicAttributeContext(); pushContext(context, request); } return context; }
/** * Returns the current attribute context. * * @param tilesContext The request context to use. * @return The current attribute context. */ private AttributeContext getAttributeContext(TilesRequestContext tilesContext) { AttributeContext context = getContext(tilesContext); if (context == null) { context = new BasicAttributeContext(); pushContext(context, tilesContext); } return context; }
/** * Execute a preparer. * * @param context The request context. * @param preparerName The name of the preparer. * @param ignoreMissing If <code>true</code> if the preparer is not found, * it ignores the problem. * @throws NoSuchPreparerException If the preparer is not found (and * <code>ignoreMissing</code> is not set) or if the preparer itself threw an * exception. */ private void prepare(TilesRequestContext context, String preparerName, boolean ignoreMissing) { if (log.isDebugEnabled()) { log.debug("Prepare request received for '" + preparerName); } ViewPreparer preparer = preparerFactory.getPreparer(preparerName, context); if (preparer == null && ignoreMissing) { return; } if (preparer == null) { throw new NoSuchPreparerException("Preparer '" + preparerName + " not found"); } AttributeContext attributeContext = getContext(context); preparer.execute(context, attributeContext); }
/** * Execute a preparer. * * @param context The request context. * @param preparerName The name of the preparer. * @param ignoreMissing If <code>true</code> if the preparer is not found, * it ignores the problem. * @throws NoSuchPreparerException If the preparer is not found (and * <code>ignoreMissing</code> is not set) or if the preparer itself threw an * exception. */ private void prepare(Request context, String preparerName, boolean ignoreMissing) { log.debug("Prepare request received for '{}'", preparerName); ViewPreparer preparer = preparerFactory.getPreparer(preparerName, context); if (preparer == null && ignoreMissing) { return; } if (preparer == null) { throw new NoSuchPreparerException("Preparer '" + preparerName + " not found"); } AttributeContext attributeContext = getContext(context); preparer.execute(context, attributeContext); }