/** * Returns the original servlet context. * * @param context The application context. * @return The original servlet context, if found. * @deprecated Use {@link TilesApplicationContext#getContext()}. */ protected ServletContext getServletContext(TilesApplicationContext context) { return (ServletContext) context.getContext(); } }
/** {@inheritDoc} */ public Object getContext() { return rootContext.getContext(); }
/** {@inheritDoc} */ public Object getContext() { return context.getContext(); }
/** {@inheritDoc} */ public void setApplicationContext(TilesApplicationContext applicationContext) { Object context = applicationContext.getContext(); if (context instanceof ServletContext) { this.servletContext = (ServletContext) context; } else { throw new IllegalArgumentException( "The application context does not hold an instance of " + "ServletContext, consider using JuelExpressionFactoryFactory"); } }
/** * Creates the Tiles application context, to be used across all the * Tiles-based application. If you override this class, please override this * method or * {@link #createAndInitializeTilesApplicationContextFactory(TilesApplicationContext)}. * * @param preliminaryContext The preliminary application context to use. * @return The Tiles application context. * @since 2.1.2 */ protected TilesApplicationContext createTilesApplicationContext( TilesApplicationContext preliminaryContext) { AbstractTilesApplicationContextFactory acFactory = createAndInitializeTilesApplicationContextFactory(preliminaryContext); return acFactory.createApplicationContext(preliminaryContext.getContext()); }