Skip to content

Commit 9998c63

Browse files
committed
Compact headings in Web Servlet section
Optimized for viewing in left TOC.
1 parent b47905f commit 9998c63

File tree

6 files changed

+193
-202
lines changed

6 files changed

+193
-202
lines changed

src/docs/asciidoc/web/integration.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
[[web-integration]]
3-
= Other Web Frameworks
3+
= 3rd Party Web Frameworks
44

55

66
[[intro]]
@@ -19,7 +19,7 @@ popular third party web frameworks.
1919

2020

2121
[[web-integration-common]]
22-
== Common configuration
22+
== Common config
2323
Before diving into the integration specifics of each supported web framework, let us
2424
first take a look at the Spring configuration that is __not__ specific to any one web
2525
framework. (This section is equally applicable to Spring's own web framework, Spring
@@ -103,7 +103,7 @@ has more detail on its specific integration strategies.
103103

104104

105105
[[jsf]]
106-
== JavaServer Faces 1.2
106+
== JSF 1.2
107107
JavaServer Faces (JSF) is the JCP's standard component-based, event-driven web user
108108
interface framework. As of Java EE 5, it is an official part of the Java EE umbrella.
109109

@@ -123,10 +123,10 @@ http://projects.spring.io/spring-webflow[Spring Web Flow website] for details!
123123
The key element in Spring's JSF integration is the JSF `ELResolver` mechanism.
124124

125125
[[jsf-springbeanfaceselresolver]]
126-
=== SpringBeanFacesELResolver (JSF 1.2+)
126+
=== Spring Bean Resolver
127127
`SpringBeanFacesELResolver` is a JSF 1.2 compliant `ELResolver` implementation,
128128
integrating with the standard Unified EL as used by JSF 1.2 and JSP 2.1. Like
129-
`SpringBeanVariableResolver`, it delegates to the Spring's 'business context'
129+
`SpringBeanVariableResolver`, it delegates to the Spring's 'business context'
130130
`WebApplicationContext` __first__, then to the default resolver of the underlying JSF
131131
implementation.
132132

src/docs/asciidoc/web/webflux.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ of defaults along with the ability to override or replace those defaults.
435435

436436

437437
[[webflux-dispatcher-handler]]
438-
== The DispatcherHandler
438+
== DispatcherHandler
439439
[.small]#<<web.adoc#mvc-servlet,Same in Spring MVC>>#
440440

441441
Spring WebFlux, like Spring MVC, is designed around the front controller pattern where a
@@ -1020,7 +1020,7 @@ easy to seem them in `WebFluxConfigurationSupport`, and if you want to learn mor
10201020

10211021

10221022
[[webflux-config-enable]]
1023-
=== Enable the configuration
1023+
=== Enable WebFlux config
10241024
[.small]#<<web.adoc#mvc-config-enable,Same in Spring MVC>>#
10251025

10261026
Use the `@EnableWebFlux` annotation in your Java config:
@@ -1040,7 +1040,7 @@ available on the classpath -- for JSON, XML, etc.
10401040

10411041

10421042
[[webflux-config-customize]]
1043-
=== Configuration API
1043+
=== WebFlux config API
10441044
[.small]#<<web.adoc#mvc-config-customize,Same in Spring MVC>>#
10451045

10461046
In your Java config implement the `WebFluxConfigurer` interface:

src/docs/asciidoc/web/webmvc-cors.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[mvc-cors]]
2-
= CORS Support
2+
= CORS
33

44
== Introduction
55

@@ -31,7 +31,7 @@ Since CORS requests are automatically dispatched, you *do not need* to change th
3131
(`false`) is the recommended approach.
3232
====
3333

34-
== Controller method CORS configuration
34+
== @Controller CORS
3535

3636
You can add an
3737
{api-spring-framework}/web/bind/annotation/CrossOrigin.html[`@CrossOrigin`]
@@ -109,14 +109,14 @@ public class AccountController {
109109
}
110110
----
111111

112-
== Global CORS configuration
112+
== Global CORS
113113

114114
In addition to fine-grained, annotation-based configuration you'll probably want to
115115
define some global CORS configuration as well. This is similar to using filters but can
116116
be declared within Spring MVC and combined with fine-grained `@CrossOrigin` configuration.
117117
By default all origins and `GET`, `HEAD`, and `POST` methods are allowed.
118118

119-
=== JavaConfig
119+
=== MVC Java Config
120120

121121
Enabling CORS for the whole application is as simple as:
122122

@@ -156,7 +156,7 @@ public class WebConfig implements WebMvcConfigurer {
156156
}
157157
----
158158

159-
=== XML namespace
159+
=== MVC XML Config
160160

161161
The following minimal XML configuration enables CORS for the `/**` path pattern with
162162
the same default properties as with the aforementioned JavaConfig examples:
@@ -205,7 +205,7 @@ It can be provided in various ways:
205205
now does) in order to provide a {api-spring-framework}/web/cors/CorsConfiguration.html[CorsConfiguration]
206206
instance for each request.
207207

208-
== Filter based CORS support
208+
== CORS Filter
209209

210210
In order to support CORS with filter-based security frameworks like
211211
http://projects.spring.io/spring-security/[Spring Security], or

src/docs/asciidoc/web/webmvc-view.adoc

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ documentation section for more details.
2727

2828

2929
[[mvc-view-groovymarkup]]
30-
== Groovy Markup Templates
30+
== Groovy Markup
3131

3232
The http://groovy-lang.org/templating.html#_the_markuptemplateengine[Groovy Markup Template Engine]
3333
is another view technology, supported by Spring. This template engine is a template engine primarily
@@ -157,7 +157,7 @@ for JSP's. So if your controller returns a ModelAndView object containing a view
157157

158158

159159
[[mvc-views-freemarker]]
160-
=== Advanced FreeMarker configuration
160+
=== Advanced config
161161
FreeMarker 'Settings' and 'SharedVariables' can be passed directly to the FreeMarker
162162
`Configuration` object managed by Spring by setting the appropriate bean properties on
163163
the `FreeMarkerConfigurer` bean. The `freemarkerSettings` property requires a
@@ -185,7 +185,7 @@ the `Configuration` object.
185185

186186

187187
[[mvc-view-freemarker-forms]]
188-
=== Bind support and form handling
188+
=== Form handling
189189
Spring provides a tag library for use in JSP's that contains (amongst other things) a
190190
`<spring:bind/>` tag. This tag primarily enables forms to display values from form
191191
backing objects and to show the results of failed validations from a `Validator` in the
@@ -251,7 +251,7 @@ They are explained in the next section.
251251

252252

253253
[[mvc-views-form-macros]]
254-
==== Form input generation macros
254+
==== Input macros
255255
Additional convenience macros for both languages simplify both binding and form
256256
generation (including validation error display). It is never necessary to use these
257257
macros to generate form input fields, and they can be mixed and matched with simple HTML
@@ -456,7 +456,7 @@ user still sees the more user friendly city names.
456456

457457

458458
[[mvc-views-form-macros-html-escaping]]
459-
==== HTML escaping and XHTML compliance
459+
==== HTML escaping
460460
Default usage of the form macros above will result in HTML tags that are HTML 4.01
461461
compliant and that use the default value for HTML escaping defined in your web.xml as
462462
used by Spring's bind support. In order to make the tags XHTML compliant or to override
@@ -560,15 +560,15 @@ under the `'WEB-INF'` directory, so there can be no direct access by clients.
560560

561561

562562
[[mvc-view-jsp-jstl]]
563-
=== 'Plain-old' JSPs versus JSTL
563+
=== JSPs versus JSTL
564564
When using the Java Standard Tag Library you must use a special view class, the
565565
`JstlView`, as JSTL needs some preparation before things such as the I18N features will
566566
work.
567567

568568

569569

570570
[[mvc-view-jsp-tags]]
571-
=== Additional tags facilitating development
571+
=== Spring tags
572572
Spring provides data binding of request parameters to command objects as described in
573573
earlier chapters. To facilitate the development of JSP pages in combination with those
574574
data binding features, Spring provides a few tags that make things even easier. All
@@ -581,7 +581,7 @@ or see the tag library description.
581581

582582

583583
[[mvc-view-jsp-formtaglib]]
584-
=== Using Spring's form tag library
584+
=== Spring form tags
585585
As of version 2.0, Spring provides a comprehensive set of data binding-aware tags for
586586
handling form elements when using JSP and Spring Web MVC. Each tag provides support for
587587
the set of attributes of its corresponding HTML tag counterpart, making the tags
@@ -1338,7 +1338,7 @@ is the default type.
13381338

13391339

13401340
[[mvc-view-script]]
1341-
== Script templates
1341+
== Script views
13421342

13431343
It is possible to integrate any templating library running on top of a JSR-223
13441344
script engine in web applications using Spring. The following describes in a
@@ -1355,7 +1355,7 @@ It has been tested with:
13551355
* https://docs.python.org/2/library/string.html#template-strings[String templates] running on http://www.jython.org/[Jython]
13561356

13571357
[[mvc-view-script-dependencies]]
1358-
=== Dependencies
1358+
=== Requirements
13591359

13601360
To be able to use script templates integration, you need to have available in your classpath
13611361
the script engine:
@@ -1375,7 +1375,7 @@ in order to make your javascript libraries available in the classpath.
13751375

13761376

13771377
[[mvc-view-script-integrate]]
1378-
=== How to integrate script based templating
1378+
=== Script templates
13791379

13801380
To be able to use script templates, you have to configure it in order to specify various parameters
13811381
like the script engine to use, the script files to load and what function should be called to
@@ -1535,7 +1535,7 @@ for more configuration examples.
15351535

15361536

15371537
[[mvc-view-xml-marshalling]]
1538-
== XML Marshalling View
1538+
== XML Marshalling
15391539
The `MarshallingView` uses an XML `Marshaller` defined in the `org.springframework.oxm`
15401540
package to render the response content as XML. The object to be marshalled can be set
15411541
explicitly using `MarhsallingView`'s `modelKey` bean property. Alternatively, the view
@@ -1569,7 +1569,7 @@ to your project.
15691569

15701570

15711571
[[mvc-view-tiles-integrate]]
1572-
=== How to integrate Tiles
1572+
=== Configuration
15731573
To be able to use Tiles, you have to configure it using files containing definitions
15741574
(for basic information on definitions and other Tiles concepts, please have a look at
15751575
http://tiles.apache.org[]). In Spring this is done using the `TilesConfigurer`. Have a
@@ -1626,7 +1626,7 @@ them otherwise in the file names for Tiles definitions.
16261626

16271627

16281628
[[mvc-view-tiles-url]]
1629-
==== UrlBasedViewResolver
1629+
==== View Resolver
16301630

16311631
The `UrlBasedViewResolver` instantiates the given `viewClass` for each view it has to
16321632
resolve.
@@ -1641,7 +1641,7 @@ resolve.
16411641

16421642

16431643
[[mvc-view-tiles-resource]]
1644-
==== ResourceBundleViewResolver
1644+
==== Resource Bundle
16451645

16461646
The `ResourceBundleViewResolver` has to be provided with a property file containing
16471647
viewnames and viewclasses the resolver can use:
@@ -1677,7 +1677,7 @@ box.
16771677

16781678

16791679
[[mvc-view-tiles-preparer]]
1680-
==== SimpleSpringPreparerFactory and SpringBeanPreparerFactory
1680+
==== Preparer Factories
16811681

16821682
As an advanced feature, Spring also supports two special Tiles `PreparerFactory`
16831683
implementations. Check out the Tiles documentation for details on how to use
@@ -1728,10 +1728,6 @@ naturally deals with XML, or if your model can easily be converted to XML. The f
17281728
section shows how to produce an XML document as model data and have it transformed with
17291729
XSLT in a Spring Web MVC application.
17301730

1731-
1732-
1733-
[[mvc-view-xslt-firstwords]]
1734-
=== My First Words
17351731
This example is a trivial Spring application that creates a list of words in the
17361732
`Controller` and adds them to the model map. The map is returned along with the view
17371733
name of our XSLT view. See <<mvc-controller>> for details of Spring Web MVC's
@@ -1740,7 +1736,7 @@ document ready for transformation.
17401736

17411737

17421738
[[mvc-view-xslt-beandefs]]
1743-
==== Bean definitions
1739+
=== Beans
17441740
Configuration is standard for a simple Spring application.
17451741
The MVC configuration has to define a `XsltViewResolver` bean and
17461742
regular MVC annotation configuration.
@@ -1768,7 +1764,7 @@ And we need a Controller that encapsulates our word generation logic.
17681764

17691765

17701766
[[mvc-view-xslt-controllercode]]
1771-
==== Standard MVC controller code
1767+
=== Controller
17721768

17731769
The controller logic is encapsulated in a `@Controller` class, with the
17741770
handler method being defined like so...
@@ -1814,7 +1810,7 @@ DOM document into it to generate our view.
18141810

18151811

18161812
[[mvc-view-xslt-transforming]]
1817-
==== Document transformation
1813+
=== Transformation
18181814

18191815
Finally, the `XsltViewResolver` will resolve the "home" XSLT template file and merge the
18201816
DOM document into it to generate our view. As shown in the `XsltViewResolver`
@@ -1871,7 +1867,7 @@ This is rendered as:
18711867
----
18721868

18731869
[[mvc-view-document]]
1874-
== Document views (PDF/Excel)
1870+
== PDF, Excel
18751871

18761872

18771873

@@ -1889,15 +1885,15 @@ for PDF generation, the iText library.
18891885

18901886

18911887
[[mvc-view-document-config]]
1892-
=== Configuration and setup
1888+
=== Configuration
18931889
Document based views are handled in an almost identical fashion to XSLT views, and the
18941890
following sections build upon the previous one by demonstrating how the same controller
18951891
used in the XSLT example is invoked to render the same model as both a PDF document and
18961892
an Excel spreadsheet (which can also be viewed or manipulated in Open Office).
18971893

18981894

18991895
[[mvc-view-document-configviews]]
1900-
==== Document view definitions
1896+
=== View definition
19011897
First, let's amend the views.properties file (or xml equivalent) and add a simple view
19021898
definition for both document types. The entire file now looks like this with the XSLT
19031899
view shown from earlier:
@@ -1919,15 +1915,15 @@ model data to, specify the location as the 'url' property in the view definition
19191915

19201916

19211917
[[mvc-view-document-configcontroller]]
1922-
==== Controller code
1918+
=== Controller
19231919
The controller code we'll use remains exactly the same from the XSLT example earlier
19241920
other than to change the name of the view to use. Of course, you could be clever and
19251921
have this selected based on a URL parameter or some other logic - proof that Spring
19261922
really is very good at decoupling the views from the controllers!
19271923

19281924

19291925
[[mvc-view-document-configsubclasses]]
1930-
==== Subclassing for Excel views
1926+
=== Excel views
19311927
Exactly as we did for the XSLT example, we'll subclass suitable abstract classes in
19321928
order to implement custom behavior in generating our output documents. For Excel, this
19331929
involves writing a subclass of
@@ -2011,7 +2007,7 @@ same page as before.
20112007

20122008

20132009
[[mvc-view-document-configsubclasspdf]]
2014-
==== Subclassing for PDF views
2010+
=== PDF views
20152011
The PDF version of the word list is even simpler. This time, the class extends
20162012
`org.springframework.web.servlet.view.document.AbstractPdfView` and implements the
20172013
`buildPdfDocument()` method as follows:
@@ -2044,7 +2040,7 @@ document should appear listing each of the words in the model map.
20442040

20452041

20462042
[[mvc-view-feeds]]
2047-
== Feed Views
2043+
== RSS Feeds
20482044
Both `AbstractAtomFeedView` and `AbstractRssFeedView` inherit from the base class
20492045
`AbstractFeedView` and are used to provide Atom and RSS Feed views respectfully. They
20502046
are based on java.net's https://rome.dev.java.net[ROME] project and are located in the
@@ -2105,10 +2101,11 @@ For an example of creating an Atom view please refer to Alef Arendsen's Spring T
21052101
https://spring.io/blog/2009/03/16/adding-an-atom-view-to-an-application-using-spring-s-rest-support[entry].
21062102

21072103

2108-
2104+
[[mvc-view-jackson]]
2105+
== Jackson
21092106

21102107
[[mvc-view-json-mapping]]
2111-
== JSON Mapping View
2108+
=== JSON
21122109
The `MappingJackson2JsonView` uses the Jackson library's `ObjectMapper` to render the response
21132110
content as JSON. By default, the entire contents of the model map (with the exception of
21142111
framework-specific classes) will be encoded as JSON. For cases where the contents of the
@@ -2130,7 +2127,7 @@ name(s) could be customized through the `jsonpParameterNames` property.
21302127

21312128

21322129
[[mvc-view-xml-mapping]]
2133-
== XML Mapping View
2130+
=== XML
21342131
The `MappingJackson2XmlView` uses the
21352132
https://github.com/FasterXML/jackson-dataformat-xml[Jackson XML extension]'s `XmlMapper`
21362133
to render the response content as XML. If the model contains multiples entries, the

0 commit comments

Comments
 (0)