Fix typos, formatting and escaping in reference
Note: Some symbol combinations (including <=) serve as textual symbol replacements in AsciiDoc. http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#text-replacement
This commit is contained in:
parent
22a8a668c9
commit
8f525f07e9
|
@ -46,7 +46,7 @@ import java.lang.annotation.Target;
|
||||||
* beans, provide stub implementations of your lookup methods to be able to declare
|
* beans, provide stub implementations of your lookup methods to be able to declare
|
||||||
* them as concrete classes. And please remember that lookup methods won't work on
|
* them as concrete classes. And please remember that lookup methods won't work on
|
||||||
* beans returned from {@code @Bean} methods in configuration classes; you'll have
|
* beans returned from {@code @Bean} methods in configuration classes; you'll have
|
||||||
* to resort to {@code @Inject Provider<TargetBean>} or the like instead.
|
* to resort to {@code @Inject Provider<TargetBean>} or the like instead.
|
||||||
*
|
*
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
* @since 4.1
|
* @since 4.1
|
||||||
|
|
|
@ -5624,7 +5624,7 @@ support for autowiring of `@Bean` methods:
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
The example autowires the `String` method parameter `country` to the value of the `Age`
|
The example autowires the `String` method parameter `country` to the value of the `age`
|
||||||
property on another bean named `privateInstance`. A Spring Expression Language element
|
property on another bean named `privateInstance`. A Spring Expression Language element
|
||||||
defines the value of the property through the notation `#{ <expression> }`. For `@Value`
|
defines the value of the property through the notation `#{ <expression> }`. For `@Value`
|
||||||
annotations, an expression resolver is preconfigured to look for bean names when
|
annotations, an expression resolver is preconfigured to look for bean names when
|
||||||
|
|
|
@ -778,11 +778,11 @@ expression based `matches` operator.
|
||||||
|
|
||||||
// evaluates to true
|
// evaluates to true
|
||||||
boolean trueValue = parser.parseExpression(
|
boolean trueValue = parser.parseExpression(
|
||||||
"'5.00' matches '\^-?\\d+(\\.\\d{2})?$'").getValue(Boolean.class);
|
"'5.00' matches '^-?\\d+(\\.\\d{2})?$'").getValue(Boolean.class);
|
||||||
|
|
||||||
//evaluates to false
|
//evaluates to false
|
||||||
boolean falseValue = parser.parseExpression(
|
boolean falseValue = parser.parseExpression(
|
||||||
"'5.0067' matches '\^-?\\d+(\\.\\d{2})?$'").getValue(Boolean.class);
|
"'5.0067' matches '^-?\\d+(\\.\\d{2})?$'").getValue(Boolean.class);
|
||||||
----
|
----
|
||||||
|
|
||||||
[NOTE]
|
[NOTE]
|
||||||
|
@ -795,7 +795,7 @@ evaluates to `true`, as expected.
|
||||||
Each symbolic operator can also be specified as a purely alphabetic equivalent. This
|
Each symbolic operator can also be specified as a purely alphabetic equivalent. This
|
||||||
avoids problems where the symbols used have special meaning for the document type in
|
avoids problems where the symbols used have special meaning for the document type in
|
||||||
which the expression is embedded (eg. an XML document). The textual equivalents are
|
which the expression is embedded (eg. an XML document). The textual equivalents are
|
||||||
shown here: `lt` (`<`), `gt` (`>`), `le` (`<=`), `ge` (`>=`), `eq` (`==`),
|
shown here: `lt` (`<`), `gt` (`>`), `le` (`\<=`), `ge` (`>=`), `eq` (`==`),
|
||||||
`ne` (`!=`), `div` (`/`), `mod` (`%`), `not` (`!`). These are case insensitive.
|
`ne` (`!=`), `div` (`/`), `mod` (`%`), `not` (`!`). These are case insensitive.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1230,7 +1230,8 @@ where the entry value is less than 27.
|
||||||
|
|
||||||
In addition to returning all the selected elements, it is possible to retrieve just the
|
In addition to returning all the selected elements, it is possible to retrieve just the
|
||||||
first or the last value. To obtain the first entry matching the selection the syntax is
|
first or the last value. To obtain the first entry matching the selection the syntax is
|
||||||
`^[...]` whilst to obtain the last matching selection the syntax is `$[...]`.
|
`.^[selectionExpression]` whilst to obtain the last matching selection the syntax is
|
||||||
|
`.$[selectionExpression]`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1238,7 +1239,7 @@ first or the last value. To obtain the first entry matching the selection the sy
|
||||||
=== Collection Projection
|
=== Collection Projection
|
||||||
|
|
||||||
Projection allows a collection to drive the evaluation of a sub-expression and the
|
Projection allows a collection to drive the evaluation of a sub-expression and the
|
||||||
result is a new collection. The syntax for projection is `![projectionExpression]`. Most
|
result is a new collection. The syntax for projection is `.![projectionExpression]`. Most
|
||||||
easily understood by example, suppose we have a list of inventors but want the list of
|
easily understood by example, suppose we have a list of inventors but want the list of
|
||||||
cities where they were born. Effectively we want to evaluate 'placeOfBirth.city' for
|
cities where they were born. Effectively we want to evaluate 'placeOfBirth.city' for
|
||||||
every entry in the inventor list. Using projection:
|
every entry in the inventor list. Using projection:
|
||||||
|
|
|
@ -494,9 +494,9 @@ When the path location contains an Ant-style pattern, for example:
|
||||||
[subs="verbatim"]
|
[subs="verbatim"]
|
||||||
----
|
----
|
||||||
/WEB-INF/*-context.xml
|
/WEB-INF/*-context.xml
|
||||||
com/mycompany/**/applicationContext.xml
|
com/mycompany/**/applicationContext.xml
|
||||||
file:C:/some/path/*-context.xml
|
file:C:/some/path/*-context.xml
|
||||||
classpath:com/mycompany/**/applicationContext.xml
|
classpath:com/mycompany/**/applicationContext.xml
|
||||||
----
|
----
|
||||||
|
|
||||||
The resolver follows a more complex but defined procedure to try to resolve the
|
The resolver follows a more complex but defined procedure to try to resolve the
|
||||||
|
@ -512,7 +512,7 @@ the wildcards.
|
||||||
===== Implications on portability
|
===== Implications on portability
|
||||||
|
|
||||||
If the specified path is already a file URL (either explicitly, or implicitly because
|
If the specified path is already a file URL (either explicitly, or implicitly because
|
||||||
the base `ResourceLoader` is a filesystem one, then wildcarding is guaranteed to work in
|
the base `ResourceLoader` is a filesystem one), then wildcarding is guaranteed to work in
|
||||||
a completely portable fashion.
|
a completely portable fashion.
|
||||||
|
|
||||||
If the specified path is a classpath location, then the resolver must obtain the last
|
If the specified path is a classpath location, then the resolver must obtain the last
|
||||||
|
|
|
@ -209,7 +209,7 @@ generation (including validation error display). It is never necessary to use th
|
||||||
macros to generate form input fields, and they can be mixed and matched with simple HTML
|
macros to generate form input fields, and they can be mixed and matched with simple HTML
|
||||||
or calls direct to the spring bind macros highlighted previously.
|
or calls direct to the spring bind macros highlighted previously.
|
||||||
|
|
||||||
The following table of available macros show the VTL and FTL definitions and the
|
The following table of available macros show the FTL definitions and the
|
||||||
parameter list that each takes.
|
parameter list that each takes.
|
||||||
|
|
||||||
[[views-macros-defs-tbl]]
|
[[views-macros-defs-tbl]]
|
||||||
|
@ -262,9 +262,9 @@ parameter list that each takes.
|
||||||
| <@spring.showErrors separator, classOrStyle/>
|
| <@spring.showErrors separator, classOrStyle/>
|
||||||
|===
|
|===
|
||||||
|
|
||||||
* In FTL (FreeMarker), these two macros are not actually required as you can use the
|
* In FTL (FreeMarker), `formHiddenInput` and `formPasswordInput` are not actually required
|
||||||
normal `formInput` macro, specifying ' `hidden`' or ' `password`' as the value for the
|
as you can use the normal `formInput` macro, specifying `hidden` or `password` as the
|
||||||
`fieldType` parameter.
|
value for the `fieldType` parameter.
|
||||||
|
|
||||||
The parameters to any of the above macros have consistent meanings:
|
The parameters to any of the above macros have consistent meanings:
|
||||||
|
|
||||||
|
@ -420,14 +420,14 @@ your model where they will be visible to your templates). The advantage of speci
|
||||||
them in the templates is that they can be changed to different values later in the
|
them in the templates is that they can be changed to different values later in the
|
||||||
template processing to provide different behavior for different fields in your form.
|
template processing to provide different behavior for different fields in your form.
|
||||||
|
|
||||||
To switch to XHTML compliance for your tags, specify a value of 'true' for a
|
To switch to XHTML compliance for your tags, specify a value of `true` for a
|
||||||
model/context variable named xhtmlCompliant:
|
model/context variable named xhtmlCompliant:
|
||||||
|
|
||||||
[source,jsp,indent=0]
|
[source,jsp,indent=0]
|
||||||
[subs="verbatim,quotes"]
|
[subs="verbatim,quotes"]
|
||||||
----
|
----
|
||||||
<#-- for FreeMarker -->
|
<#-- for FreeMarker -->
|
||||||
<#assign xhtmlCompliant = true in spring>
|
<#assign xhtmlCompliant = true>
|
||||||
----
|
----
|
||||||
|
|
||||||
Any tags generated by the Spring macros will now be XHTML compliant after processing
|
Any tags generated by the Spring macros will now be XHTML compliant after processing
|
||||||
|
@ -435,12 +435,12 @@ this directive.
|
||||||
|
|
||||||
In similar fashion, HTML escaping can be specified per field:
|
In similar fashion, HTML escaping can be specified per field:
|
||||||
|
|
||||||
[source,xml,indent=0]
|
[source,jsp,indent=0]
|
||||||
[subs="verbatim,quotes"]
|
[subs="verbatim,quotes"]
|
||||||
----
|
----
|
||||||
<#-- until this point, default HTML escaping is used -->
|
<#-- until this point, default HTML escaping is used -->
|
||||||
|
|
||||||
<#assign htmlEscape = true in spring>
|
<#assign htmlEscape = true>
|
||||||
<#-- next field will use HTML escaping -->
|
<#-- next field will use HTML escaping -->
|
||||||
<@spring.formInput "command.name"/>
|
<@spring.formInput "command.name"/>
|
||||||
|
|
||||||
|
|
|
@ -479,7 +479,7 @@ initialization parameters ( `init-param` elements) to the Servlet declaration in
|
||||||
All `HandlerMapping` implementations supports handler interceptors that are useful when
|
All `HandlerMapping` implementations supports handler interceptors that are useful when
|
||||||
you want to apply specific functionality to certain requests, for example, checking for
|
you want to apply specific functionality to certain requests, for example, checking for
|
||||||
a principal. Interceptors must implement `HandlerInterceptor` from the
|
a principal. Interceptors must implement `HandlerInterceptor` from the
|
||||||
`org.springframework .web .servlet` package with three methods that should provide enough
|
`org.springframework.web.servlet` package with three methods that should provide enough
|
||||||
flexibility to do all kinds of pre-processing and post-processing:
|
flexibility to do all kinds of pre-processing and post-processing:
|
||||||
|
|
||||||
* `preHandle(..)` -- __before__ the actual handler is executed
|
* `preHandle(..)` -- __before__ the actual handler is executed
|
||||||
|
@ -498,7 +498,7 @@ configure interceptors. You can also register them directly via setters on indiv
|
||||||
`HandlerMapping` implementations.
|
`HandlerMapping` implementations.
|
||||||
|
|
||||||
Note that `postHandle` is less useful with `@ResponseBody` and `ResponseEntity` methods for
|
Note that `postHandle` is less useful with `@ResponseBody` and `ResponseEntity` methods for
|
||||||
which a the response is written and committed within the `HandlerAdapter` and before
|
which the response is written and committed within the `HandlerAdapter` and before
|
||||||
`postHandle`. That means its too late to make any changes to the response such as adding
|
`postHandle`. That means its too late to make any changes to the response such as adding
|
||||||
an extra header. For such scenarios you can implement `ResponseBodyAdvice` and either
|
an extra header. For such scenarios you can implement `ResponseBodyAdvice` and either
|
||||||
declare it as an <<mvc-ann-controller-advice>> bean or configure it directly on
|
declare it as an <<mvc-ann-controller-advice>> bean or configure it directly on
|
||||||
|
@ -2543,8 +2543,8 @@ on a container object that specifies request headers and body. Below is an examp
|
||||||
@PostMapping("/something")
|
@PostMapping("/something")
|
||||||
public ResponseEntity<String> handle() {
|
public ResponseEntity<String> handle() {
|
||||||
// ...
|
// ...
|
||||||
URI location = ...
|
URI location = ... ;
|
||||||
return new ResponseEntity.created(location).build();
|
return ResponseEntity.created(location).build();
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@ -4167,8 +4167,7 @@ And the same in XML use the `<mvc:view-controller>` element:
|
||||||
The MVC config simplifies the registration of view resolvers.
|
The MVC config simplifies the registration of view resolvers.
|
||||||
|
|
||||||
The following is a Java config example that configures content negotiation view
|
The following is a Java config example that configures content negotiation view
|
||||||
resolution using FreeMarker HTML templates and Jackson as a default `View` for
|
resolution using JSP and Jackson as a default `View` for JSON rendering:
|
||||||
JSON rendering:
|
|
||||||
|
|
||||||
[source,java,indent=0]
|
[source,java,indent=0]
|
||||||
[subs="verbatim,quotes"]
|
[subs="verbatim,quotes"]
|
||||||
|
@ -4296,8 +4295,8 @@ See also
|
||||||
<<mvc-caching-static-resources, HTTP caching support for static resources>>.
|
<<mvc-caching-static-resources, HTTP caching support for static resources>>.
|
||||||
|
|
||||||
The resource handler also supports a chain of
|
The resource handler also supports a chain of
|
||||||
{api-spring-framework}/web/servlet/resource/ResourceResolver.html[ResourceResolver]'s and
|
{api-spring-framework}/web/servlet/resource/ResourceResolver.html[ResourceResolver]s and
|
||||||
{api-spring-framework}/web/servlet/resource/ResourceTransformer.html[ResourceTransformer]'s.
|
{api-spring-framework}/web/servlet/resource/ResourceTransformer.html[ResourceTransformer]s.
|
||||||
which can be used to create a toolchain for working with optimized resources.
|
which can be used to create a toolchain for working with optimized resources.
|
||||||
|
|
||||||
The `VersionResourceResolver` can be used for versioned resource URLs based on an MD5 hash
|
The `VersionResourceResolver` can be used for versioned resource URLs based on an MD5 hash
|
||||||
|
|
Loading…
Reference in New Issue