From 047f66057217be3971f02974c4744f7940ff3d74 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 19 Jan 2023 16:43:51 +0100 Subject: [PATCH] Remove obsolete Tiles documentation from reference manual Tiles support was officially removed in conjunction with gh-27423. Closes gh-29852 --- .../src/docs/asciidoc/web/webmvc-view.adoc | 132 ------------------ .../src/docs/asciidoc/web/webmvc.adoc | 6 +- 2 files changed, 3 insertions(+), 135 deletions(-) diff --git a/framework-docs/src/docs/asciidoc/web/webmvc-view.adoc b/framework-docs/src/docs/asciidoc/web/webmvc-view.adoc index 2b0b03c1399..855774b3989 100644 --- a/framework-docs/src/docs/asciidoc/web/webmvc-view.adoc +++ b/framework-docs/src/docs/asciidoc/web/webmvc-view.adoc @@ -1649,138 +1649,6 @@ is the default type. -[[mvc-view-tiles]] -== Tiles - -You can integrate Tiles - just as any other view technology - in web -applications that use Spring. This section describes, in a broad way, how to do so. - -NOTE: This section focuses on Spring's support for Tiles version 3 in the -`org.springframework.web.servlet.view.tiles3` package. - - - -[[mvc-view-tiles-dependencies]] -=== Dependencies - -To be able to use Tiles, you have to add a dependency on Tiles version 3.0.1 or higher -and https://tiles.apache.org/framework/dependency-management.html[its transitive dependencies] -to your project. - - - -[[mvc-view-tiles-integrate]] -=== Configuration - -To be able to use Tiles, you have to configure it by using files that contain definitions -(for basic information on definitions and other Tiles concepts, see -https://tiles.apache.org[]). In Spring, this is done by using the `TilesConfigurer`. -The following example `ApplicationContext` configuration shows how to do so: - -[source,xml,indent=0,subs="verbatim,quotes"] ----- - - - - /WEB-INF/defs/general.xml - /WEB-INF/defs/widgets.xml - /WEB-INF/defs/administrator.xml - /WEB-INF/defs/customer.xml - /WEB-INF/defs/templates.xml - - - ----- - -The preceding example defines five files that contain definitions. The files are all -located in the `WEB-INF/defs` directory. At initialization of the `WebApplicationContext`, -the files are loaded, and the definitions factory are initialized. After that has -been done, the Tiles included in the definition files can be used as views within your -Spring web application. To be able to use the views, you have to have a `ViewResolver` -as with any other view technology in Spring: typically a convenient `TilesViewResolver`. - -You can specify locale-specific Tiles definitions by adding an underscore and then -the locale, as the following example shows: - -[source,xml,indent=0,subs="verbatim,quotes"] ----- - - - - /WEB-INF/defs/tiles.xml - /WEB-INF/defs/tiles_fr_FR.xml - - - ----- - -With the preceding configuration, `tiles_fr_FR.xml` is used for requests with the `fr_FR` locale, -and `tiles.xml` is used by default. - -NOTE: Since underscores are used to indicate locales, we recommended not using -them otherwise in the file names for Tiles definitions. - - - -[[mvc-view-tiles-url]] -==== `UrlBasedViewResolver` - -The `UrlBasedViewResolver` instantiates the given `viewClass` for each view it has to -resolve. The following bean defines a `UrlBasedViewResolver`: - -[source,xml,indent=0,subs="verbatim,quotes"] ----- - - - ----- - - -[[mvc-view-tiles-preparer]] -==== `SimpleSpringPreparerFactory` and `SpringBeanPreparerFactory` - -As an advanced feature, Spring also supports two special Tiles `PreparerFactory` -implementations. See the Tiles documentation for details on how to use -`ViewPreparer` references in your Tiles definition files. - -You can specify `SimpleSpringPreparerFactory` to autowire `ViewPreparer` instances based on -specified preparer classes, applying Spring's container callbacks as well as applying -configured Spring BeanPostProcessors. If Spring's context-wide annotation configuration has -been activated, annotations in `ViewPreparer` classes are automatically detected and -applied. Note that this expects preparer classes in the Tiles definition files, as -the default `PreparerFactory` does. - -You can specify `SpringBeanPreparerFactory` to operate on specified preparer names (instead -of classes), obtaining the corresponding Spring bean from the DispatcherServlet's -application context. The full bean creation process is in the control of the Spring -application context in this case, allowing for the use of explicit dependency injection -configuration, scoped beans, and so on. Note that you need to define one Spring bean definition -for each preparer name (as used in your Tiles definitions). The following example shows -how to define a `SpringBeanPreparerFactory` property on a `TilesConfigurer` bean: - -[source,xml,indent=0,subs="verbatim,quotes"] ----- - - - - /WEB-INF/defs/general.xml - /WEB-INF/defs/widgets.xml - /WEB-INF/defs/administrator.xml - /WEB-INF/defs/customer.xml - /WEB-INF/defs/templates.xml - - - - - - - ----- - - - - [[mvc-view-feeds]] == RSS and Atom diff --git a/framework-docs/src/docs/asciidoc/web/webmvc.adoc b/framework-docs/src/docs/asciidoc/web/webmvc.adoc index fb8c2a12cca..5394618902b 100644 --- a/framework-docs/src/docs/asciidoc/web/webmvc.adoc +++ b/framework-docs/src/docs/asciidoc/web/webmvc.adoc @@ -802,8 +802,8 @@ The following table provides more details on the `ViewResolver` hierarchy: | `InternalResourceViewResolver` | Convenient subclass of `UrlBasedViewResolver` that supports `InternalResourceView` (in - effect, Servlets and JSPs) and subclasses such as `JstlView` and `TilesView`. You can - specify the view class for all views generated by this resolver by using `setViewClass(..)`. + effect, Servlets and JSPs) and subclasses such as `JstlView`. You can specify the view + class for all views generated by this resolver by using `setViewClass(..)`. See the {api-spring-framework}/web/reactive/result/view/UrlBasedViewResolver.html[`UrlBasedViewResolver`] javadoc for details. @@ -5888,7 +5888,7 @@ The following example shows how to achieve the same configuration in XML: ---- -Note, however, that FreeMarker, Tiles, Groovy Markup, and script templates also require +Note, however, that FreeMarker, Groovy Markup, and script templates also require configuration of the underlying view technology. The MVC namespace provides dedicated elements. The following example works with FreeMarker: