Consistent use of <pre class="code">
Issue: SPR-8108
This commit is contained in:
@@ -35,7 +35,7 @@ import org.springframework.util.Assert;
|
||||
* {@link #setSupportedMediaTypes supportedMediaTypes} property.
|
||||
* Example of usage:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean class="org.springframework.http.converter.ObjectToStringHttpMessageConverter">
|
||||
* <constructor-arg>
|
||||
* <bean class="org.springframework.context.support.ConversionServiceFactoryBean"/>
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.util.Assert;
|
||||
* <p>Example usage with
|
||||
* {@link org.springframework.http.converter.json.MappingJackson2HttpMessageConverter}:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
|
||||
* <property name="objectMapper">
|
||||
* <bean class="org.springframework.web.context.support.Jackson2ObjectMapperFactoryBean"
|
||||
@@ -58,7 +58,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* <p>Example usage with MappingJackson2JsonView:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
|
||||
* <property name="objectMapper">
|
||||
* <bean class="org.springframework.web.context.support.Jackson2ObjectMapperFactoryBean"
|
||||
@@ -78,7 +78,7 @@ import org.springframework.util.Assert;
|
||||
* options), you can still use the more general methods
|
||||
* {@link #setFeaturesToEnable(Object[])} and {@link #setFeaturesToDisable(Object[])}.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean class="org.springframework.web.context.support.Jackson2ObjectMapperFactoryBean">
|
||||
* <property name="featuresToEnable">
|
||||
* <array>
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
* to enable or disable Jackson features from within XML configuration.
|
||||
*
|
||||
* <p>Example usage with MappingJacksonHttpMessageConverter:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
|
||||
* <property name="objectMapper">
|
||||
* <bean class="org.springframework.web.context.support.JacksonObjectMapperFactoryBean"
|
||||
@@ -48,7 +48,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
* </pre>
|
||||
*
|
||||
* <p>Example usage with MappingJacksonJsonView:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
|
||||
* <property name="objectMapper">
|
||||
* <bean class="org.springframework.web.context.support.JacksonObjectMapperFactoryBean"
|
||||
@@ -63,7 +63,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
* options), you can still use the more general methods
|
||||
* {@link #setFeaturesToEnable(Object[])} and {@link #setFeaturesToDisable(Object[])}.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean class="org.springframework.web.context.support.JacksonObjectMapperFactoryBean">
|
||||
* <property name="featuresToEnable">
|
||||
* <array>
|
||||
|
||||
@@ -111,7 +111,7 @@ public class MappingJackson2HttpMessageConverter extends AbstractHttpMessageConv
|
||||
/**
|
||||
* Whether to use the {@link DefaultPrettyPrinter} when writing JSON.
|
||||
* This is a shortcut for setting up an {@code ObjectMapper} as follows:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* ObjectMapper mapper = new ObjectMapper();
|
||||
* mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
|
||||
* converter.setObjectMapper(mapper);
|
||||
|
||||
@@ -109,7 +109,7 @@ public class MappingJacksonHttpMessageConverter extends AbstractHttpMessageConve
|
||||
/**
|
||||
* Whether to use the {@link org.codehaus.jackson.util.DefaultPrettyPrinter} when writing JSON.
|
||||
* This is a shortcut for setting up an {@code ObjectMapper} as follows:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* ObjectMapper mapper = new ObjectMapper();
|
||||
* mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
|
||||
* converter.setObjectMapper(mapper);
|
||||
|
||||
@@ -321,7 +321,7 @@ public @interface RequestMapping {
|
||||
* specified header is <i>not</i> supposed to be present in the request.
|
||||
* <p>Also supports media type wildcards (*), for headers such as Accept
|
||||
* and Content-Type. For instance,
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* @RequestMapping(value = "/something", headers = "content-type=text/*")
|
||||
* </pre>
|
||||
* will match requests with a Content-Type of "text/html", "text/plain", etc.
|
||||
@@ -340,7 +340,7 @@ public @interface RequestMapping {
|
||||
* <p>The format is a single media type or a sequence of media types,
|
||||
* with a request only mapped if the {@code Content-Type} matches one of these media types.
|
||||
* Examples:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* consumes = "text/plain"
|
||||
* consumes = {"text/plain", "application/*"}
|
||||
* </pre>
|
||||
@@ -359,7 +359,7 @@ public @interface RequestMapping {
|
||||
* <p>The format is a single media type or a sequence of media types,
|
||||
* with a request only mapped if the {@code Accept} matches one of these media types.
|
||||
* Examples:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* produces = "text/plain"
|
||||
* produces = {"text/plain", "application/*"}
|
||||
* </pre>
|
||||
|
||||
@@ -79,14 +79,14 @@ import org.springframework.web.util.UriTemplate;
|
||||
* {@link #getForObject(String, Class, Map)}), and are capable of substituting any {@linkplain UriTemplate URI templates}
|
||||
* in that URL using either a {@code String} variable arguments array, or a {@code Map<String, String>}.
|
||||
* The string varargs variant expands the given template variables in order, so that
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* String result = restTemplate.getForObject("http://example.com/hotels/{hotel}/bookings/{booking}", String.class, "42",
|
||||
* "21");
|
||||
* </pre>
|
||||
* will perform a GET on {@code http://example.com/hotels/42/bookings/21}. The map variant expands the template based
|
||||
* on variable name, and is therefore more useful when using many variables, or when a single variable is used multiple
|
||||
* times. For example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* Map<String, String> vars = Collections.singletonMap("hotel", "42");
|
||||
* String result = restTemplate.getForObject("http://example.com/hotels/{hotel}/rooms/{hotel}", String.class, vars);
|
||||
* </pre>
|
||||
@@ -95,7 +95,7 @@ import org.springframework.web.util.UriTemplate;
|
||||
* expanded URI multiple times.
|
||||
*
|
||||
* <p>Furthermore, the {@code String}-argument methods assume that the URL String is unencoded. This means that
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* restTemplate.getForObject("http://example.com/hotel list");
|
||||
* </pre>
|
||||
* will perform a GET on {@code http://example.com/hotel%20list}. As a result, any URL passed that is already encoded
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
* <p>Configure this handler proxy in your {@code faces-config.xml} file
|
||||
* as follows:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <application>
|
||||
* ...
|
||||
* <navigation-handler>
|
||||
@@ -43,7 +43,7 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
* Spring bean definition like the following. However, all of Spring's bean configuration
|
||||
* power can be applied to such a bean, in particular all flavors of dependency injection.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean name="jsfNavigationHandler" class="mypackage.MyNavigationHandler">
|
||||
* <property name="myProperty" ref="myOtherBean"/>
|
||||
* </bean></pre>
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.web.jsf.FacesContextUtils;
|
||||
*
|
||||
* <p>Configure this resolver in your {@code faces-config.xml} file as follows:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <application>
|
||||
* ...
|
||||
* <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
|
||||
@@ -40,7 +40,7 @@ import org.springframework.web.jsf.FacesContextUtils;
|
||||
* Spring-managed service layer beans, for example in property values of
|
||||
* JSF-managed beans:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <managed-bean>
|
||||
* <managed-bean-name>myJsfManagedBean</managed-bean-name>
|
||||
* <managed-bean-class>example.MyJsfManagedBean</managed-bean-class>
|
||||
@@ -54,7 +54,7 @@ import org.springframework.web.jsf.FacesContextUtils;
|
||||
* with "mySpringManagedBusinessObject" defined as Spring bean in
|
||||
* applicationContext.xml:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="mySpringManagedBusinessObject" class="example.MySpringManagedBusinessObject">
|
||||
* ...
|
||||
* </bean></pre>
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.web.jsf.FacesContextUtils;
|
||||
*
|
||||
* <p>Configure this resolver in your {@code faces-config.xml} file as follows:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <application>
|
||||
* ...
|
||||
* <el-resolver>org.springframework.web.jsf.el.WebApplicationContextFacesELResolver</el-resolver>
|
||||
|
||||
@@ -150,7 +150,7 @@ public class UriComponentsBuilder {
|
||||
* contains {@code '='} or {@code '&'} characters, the query string cannot
|
||||
* be parsed unambiguously. Such values should be substituted for URI
|
||||
* variables to enable correct parsing:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* String uriString = "/hotels/42?filter={value}";
|
||||
* UriComponentsBuilder.fromUriString(uriString).buildAndExpand("hot&cold");
|
||||
* </pre>
|
||||
@@ -210,7 +210,7 @@ public class UriComponentsBuilder {
|
||||
* contains {@code '='} or {@code '&'} characters, the query string cannot
|
||||
* be parsed unambiguously. Such values should be substituted for URI
|
||||
* variables to enable correct parsing:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* String uriString = "/hotels/42?filter={value}";
|
||||
* UriComponentsBuilder.fromUriString(uriString).buildAndExpand("hot&cold");
|
||||
* </pre>
|
||||
@@ -448,7 +448,7 @@ public class UriComponentsBuilder {
|
||||
* contains {@code '='} or {@code '&'} characters, the query string cannot
|
||||
* be parsed unambiguously. Such values should be substituted for URI
|
||||
* variables to enable correct parsing:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* String uriString = "/hotels/42?filter={value}";
|
||||
* UriComponentsBuilder.fromUriString(uriString).buildAndExpand("hot&cold");
|
||||
* </pre>
|
||||
|
||||
@@ -73,7 +73,7 @@ public abstract class UriUtils {
|
||||
* <p><strong>Note</strong> that this method does not attempt to encode "=" and "&"
|
||||
* characters in query parameter names and query parameter values because they cannot
|
||||
* be parsed in a reliable way. Instead use:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* UriComponents uriComponents = UriComponentsBuilder.fromUri("/path?name={value}").buildAndExpand("a=b");
|
||||
* String encodedUri = uriComponents.encode().toUriString();
|
||||
* </pre>
|
||||
@@ -114,7 +114,7 @@ public abstract class UriUtils {
|
||||
* <p><strong>Note</strong> that this method does not attempt to encode "=" and "&"
|
||||
* characters in query parameter names and query parameter values because they cannot
|
||||
* be parsed in a reliable way. Instead use:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl("/path?name={value}").buildAndExpand("a=b");
|
||||
* String encodedUri = uriComponents.encode().toUriString();
|
||||
* </pre>
|
||||
|
||||
Reference in New Issue
Block a user