@@ -285,20 +285,20 @@ The parameters to any of the above macros have consistent meanings:
285
285
and bound to the command object. Map objects stored against the keys are the labels
286
286
displayed on the form to the user and may be different from the corresponding values
287
287
posted back by the form. Usually, such a map is supplied as reference data by the
288
- controller. You can use any `Map` implementation, depending on required behavior. For
289
- strictly sorted maps, you can use a `SortedMap` (such as a `TreeMap`) with a suitable `Comparator`
290
- and, for arbitrary Maps that should return values in insertion order, use a
291
- `LinkedHashMap` or a `LinkedMap` from `commons-collections`.
292
- * `separator`: Where multiple options are available as discreet elements (radio buttons or
293
- checkboxes), the sequence of characters used to separate each one in the list (such as
294
- `<br>`).
295
- * `attributes`: An additional string of arbitrary tags or text to be included within the
296
- HTML tag itself. This string is echoed literally by the macro. For example, in a
297
- `textarea` field, you may supply attributes (such as 'rows="5" cols="60"'), or you could pass
298
- style information such as 'style="border:1px solid silver"'.
299
- * `classOrStyle`: For the `showErrors` macro, the name of the CSS class that the `span` element
300
- that wraps each error uses. If no information is supplied (or the value is empty),
301
- the errors are wrapped in `<b></b>` tags.
288
+ controller. You can use any `Map` implementation, depending on required behavior.
289
+ For strictly sorted maps, you can use a `SortedMap` (such as a `TreeMap`) with a
290
+ suitable `Comparator` and, for arbitrary Maps that should return values in insertion
291
+ order, use a `LinkedHashMap` or a `LinkedMap` from `commons-collections`.
292
+ * `separator`: Where multiple options are available as discreet elements (radio buttons
293
+ or checkboxes), the sequence of characters used to separate each one in the list
294
+ (such as `<br>`).
295
+ * `attributes`: An additional string of arbitrary tags or text to be included within
296
+ the HTML tag itself. This string is echoed literally by the macro. For example, in a
297
+ `textarea` field, you may supply attributes (such as 'rows="5" cols="60"'), or you
298
+ could pass style information such as 'style="border:1px solid silver"'.
299
+ * `classOrStyle`: For the `showErrors` macro, the name of the CSS class that the `span`
300
+ element that wraps each error uses. If no information is supplied (or the value is
301
+ empty), the errors are wrapped in `<b></b>` tags.
302
302
303
303
The following sections outline examples of the macros (some in FTL and some in VTL). Where usage
304
304
differences exist between the two languages, they are explained in the notes.
@@ -799,7 +799,8 @@ When developing with JSPs, you can declare a `InternalResourceViewResolver` or a
799
799
800
800
`ResourceBundleViewResolver` relies on a properties file to define the view names
801
801
mapped to a class and a URL. With a `ResourceBundleViewResolver`, you
802
- can mix different types of views byusing only one resolver, as the following example shows:
802
+ can mix different types of views by using only one resolver, as the following example
803
+ shows:
803
804
804
805
====
805
806
[source,xml,indent=0]
@@ -810,17 +811,17 @@ can mix different types of views byusing only one resolver, as the following exa
810
811
<property name="basename" value="views"/>
811
812
</bean>
812
813
813
- # And a sample properties file is uses (views.properties in WEB-INF/classes):
814
+ # And a sample properties file is used (views.properties in WEB-INF/classes):
814
815
welcome.(class)=org.springframework.web.servlet.view.JstlView
815
816
welcome.url=/WEB-INF/jsp/welcome.jsp
816
817
817
818
productList.(class)=org.springframework.web.servlet.view.JstlView
818
819
productList.url=/WEB-INF/jsp/productlist.jsp
819
820
----
820
821
821
- `InternalResourceBundleViewResolver ` can also be used for JSPs. As a best practice, we
822
- strongly encourage placing your JSP files in a directory under the `'WEB-INF'`
823
- directory so there can be no direct access by clients.
822
+ `InternalResourceViewResolver ` can also be used for JSPs. As a best practice, we strongly
823
+ encourage placing your JSP files in a directory under the `'WEB-INF'` directory so there
824
+ can be no direct access by clients.
824
825
825
826
[source,xml,indent=0]
826
827
[subs="verbatim,quotes"]
@@ -838,7 +839,7 @@ directory so there can be no direct access by clients.
838
839
[[mvc-view-jsp-jstl]]
839
840
=== JSPs versus JSTL
840
841
841
- When using the Java Standard Tag Library you must use a special view class, the
842
+ When using the JSP Standard Tag Library (JSTL) you must use a special view class, the
842
843
`JstlView`, as JSTL needs some preparation before things such as the I18N features can
843
844
work.
844
845
@@ -1612,7 +1613,7 @@ or see the tag library description.
1612
1613
A key principle of REST is the use of the "`Uniform Interface`". This means that all
1613
1614
resources (URLs) can be manipulated by using the same four HTTP methods: GET, PUT, POST,
1614
1615
and DELETE. For each method, the HTTP specification defines the exact semantics. For
1615
- instance, a GET should always be a safe operation, meaning that is has no side effects,
1616
+ instance, a GET should always be a safe operation, meaning that it has no side effects,
1616
1617
and a PUT or DELETE should be idempotent, meaning that you can repeat these operations
1617
1618
over and over again, but the end result should be the same. While HTTP defines these
1618
1619
four methods, HTML only supports two: GET and POST. Fortunately, there are two possible
@@ -1625,8 +1626,7 @@ with a hidden `method` parameter is converted into the corresponding HTTP method
1625
1626
request.
1626
1627
1627
1628
To support HTTP method conversion, the Spring MVC form tag was updated to support setting
1628
- the HTTP method. For example, the following snippet comes from the Pet Clinic
1629
- sample:
1629
+ the HTTP method. For example, the following snippet comes from the Pet Clinic sample:
1630
1630
1631
1631
====
1632
1632
[source,xml,indent=0]
@@ -1638,8 +1638,8 @@ sample:
1638
1638
----
1639
1639
====
1640
1640
1641
- The preceding example perform an HTTP POST, with the "`real`" DELETE method hidden behind a
1642
- request parameter. It is picked up by the `HiddenHttpMethodFilter`, which is defined in
1641
+ The preceding example performs an HTTP POST, with the "`real`" DELETE method hidden behind
1642
+ a request parameter. It is picked up by the `HiddenHttpMethodFilter`, which is defined in
1643
1643
web.xml, as the following example shows:
1644
1644
1645
1645
====
@@ -1833,7 +1833,7 @@ implementations. See the Tiles documentation for details on how to use
1833
1833
You can specify `SimpleSpringPreparerFactory` to autowire `ViewPreparer` instances based on
1834
1834
specified preparer classes, applying Spring's container callbacks as well as applying
1835
1835
configured Spring BeanPostProcessors. If Spring's context-wide annotation configuration has
1836
- been activated, annotations in `ViewPreparer` classes aree automatically detected and
1836
+ been activated, annotations in `ViewPreparer` classes are automatically detected and
1837
1837
applied. Note that this expects preparer classes in the Tiles definition files, as
1838
1838
the default `PreparerFactory` does.
1839
1839
@@ -1843,7 +1843,7 @@ application context. The full bean creation process is in the control of the Spr
1843
1843
application context in this case, allowing for the use of explicit dependency injection
1844
1844
configuration, scoped beans, and so on. Note that you need to define one Spring bean definition
1845
1845
for each preparer name (as used in your Tiles definitions). The following example shows
1846
- how to define a set a `SpringBeanPreparerFactory` property on a `TilesConfigurer` bean:
1846
+ how to define a `SpringBeanPreparerFactory` property on a `TilesConfigurer` bean:
1847
1847
1848
1848
====
1849
1849
[source,xml,indent=0]
@@ -1911,7 +1911,7 @@ Similar requirements apply for implementing `AbstractRssFeedView`, as the follow
1911
1911
[source,java,indent=0]
1912
1912
[subs="verbatim,quotes"]
1913
1913
----
1914
- public class SampleContentAtomView extends AbstractRssFeedView {
1914
+ public class SampleContentRssView extends AbstractRssFeedView {
1915
1915
1916
1916
@Override
1917
1917
protected void buildFeedMetadata(Map<String, Object> model,
@@ -1956,13 +1956,13 @@ dynamically from the model data. The document is the view and is streamed from t
1956
1956
server with the correct content type, to (hopefully) enable the client PC to run their
1957
1957
spreadsheet or PDF viewer application in response.
1958
1958
1959
- In order to use Excel views, you need to add the Apache POI library to your classpath,
1959
+ In order to use Excel views, you need to add the Apache POI library to your classpath.
1960
1960
For PDF generation, you need to add (preferably) the OpenPDF library.
1961
1961
1962
- NOTE: You should use the latest versions of the underlying document-generation libraries, if possible.
1963
- In particular, we strongly recommend OpenPDF (for example, OpenPDF 1.0.5) instead of the
1964
- outdated original iText 2.1.7, since OpenPDF is actively maintained and fixes an important
1965
- vulnerability for untrusted PDF content.
1962
+ NOTE: You should use the latest versions of the underlying document-generation libraries,
1963
+ if possible. In particular, we strongly recommend OpenPDF (for example, OpenPDF 1.0.5)
1964
+ instead of the outdated original iText 2.1.7, since OpenPDF is actively maintained and
1965
+ fixes an important vulnerability for untrusted PDF content.
1966
1966
1967
1967
1968
1968
@@ -2027,9 +2027,9 @@ The `MappingJackson2JsonView` uses the Jackson library's `ObjectMapper` to rende
2027
2027
content as JSON. By default, the entire contents of the model map (with the exception of
2028
2028
framework-specific classes) are encoded as JSON. For cases where the contents of the
2029
2029
map need to be filtered, you can specify a specific set of model attributes to encode
2030
- by using the `modelKeys` property. You can also use the `extractValueFromSingleKeyModel` property
2031
- to have the value in single-key models extracted and serialized directly rather than
2032
- as a map of model attributes.
2030
+ by using the `modelKeys` property. You can also use the `extractValueFromSingleKeyModel`
2031
+ property to have the value in single-key models extracted and serialized directly rather
2032
+ than as a map of model attributes.
2033
2033
2034
2034
You can customize JSON mapping as needed by using Jackson's provided
2035
2035
annotations. When you need further control, you can inject a custom `ObjectMapper`
@@ -2044,9 +2044,9 @@ serializers and deserializers for specific types.
2044
2044
2045
2045
`MappingJackson2XmlView` uses the
2046
2046
https://github.com/FasterXML/jackson-dataformat-xml[Jackson XML extension's] `XmlMapper`
2047
- to render the response content as XML. If the model contains multiples entries, you should explicitly set the
2048
- object to be serialized by using the `modelKey` bean property.
2049
- If the model contains a single entry, it is serialized automatically.
2047
+ to render the response content as XML. If the model contains multiple entries, you should
2048
+ explicitly set the object to be serialized by using the `modelKey` bean property. If the
2049
+ model contains a single entry, it is serialized automatically.
2050
2050
2051
2051
You can customized XML mapping as needed by using JAXB or Jackson's provided
2052
2052
annotations. When you need further control, you can inject a custom `XmlMapper`
@@ -2060,12 +2060,11 @@ you need to provide serializers and deserializers for specific types.
2060
2060
== XML Marshalling
2061
2061
2062
2062
The `MarshallingView` uses an XML `Marshaller` (defined in the `org.springframework.oxm`
2063
- package) to render the response content as XML. You can explicitly set the object to be marshalled
2064
- by using a `MarshallingView` instance's `modelKey` bean property. Alternatively, the view
2065
- iterates over all model properties and marshals the first type that is supported
2063
+ package) to render the response content as XML. You can explicitly set the object to be
2064
+ marshalled by using a `MarshallingView` instance's `modelKey` bean property. Alternatively,
2065
+ the view iterates over all model properties and marshals the first type that is supported
2066
2066
by the `Marshaller`. For more information on the functionality in the
2067
- `org.springframework.oxm` package, see
2068
- <<data-access.adoc#oxm,Marshalling XML using O/X Mappers>>.
2067
+ `org.springframework.oxm` package, see <<data-access.adoc#oxm,Marshalling XML using O/X Mappers>>.
2069
2068
2070
2069
2071
2070
0 commit comments