parent
1ca943c681
commit
2a44228b98
|
|
@ -34,7 +34,7 @@ import org.gradle.api.invocation.*
|
|||
* dependencies (for example Hibernate v3 and v4).
|
||||
* <p>
|
||||
* The 'merge' extension should be used to define how projects are merged, for example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* configure(subprojects) {
|
||||
* apply plugin: MergePlugin
|
||||
* }
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ package org.springframework.beans.factory.aspectj;
|
|||
*
|
||||
* The subaspect of this aspect doesn't need to include any AOP constructs.
|
||||
* For example, here is a subaspect that configures the {@code PricingStrategyClient} objects.
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* aspect PricingStrategyDependencyInjectionAspect
|
||||
* extends GenericInterfaceDrivenDependencyInjectionAspect<PricingStrategyClient> {
|
||||
* private PricingStrategy pricingStrategy;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import static org.springframework.beans.PropertyDescriptorUtils.*;
|
|||
* Decorator for a standard {@link BeanInfo} object, e.g. as created by
|
||||
* {@link Introspector#getBeanInfo(Class)}, designed to discover and register static
|
||||
* and/or non-void returning setter methods. For example:
|
||||
* <pre>{@code
|
||||
* <pre class="code">
|
||||
* public class Bean {
|
||||
* private Foo foo;
|
||||
*
|
||||
|
|
@ -56,7 +56,7 @@ import static org.springframework.beans.PropertyDescriptorUtils.*;
|
|||
* this.foo = foo;
|
||||
* return this;
|
||||
* }
|
||||
* }}</pre>
|
||||
* }</pre>
|
||||
* The standard JavaBeans {@code Introspector} will discover the {@code getFoo} read
|
||||
* method, but will bypass the {@code #setFoo(Foo)} write method, because its non-void
|
||||
* returning signature does not comply with the JavaBeans specification.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.springframework.core.io.Resource;
|
|||
* <p>The mapping file should be in the following format, as specified by the
|
||||
* Java Activation Framework:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* # map text/html to .htm and .html files
|
||||
* text/html html htm HTML HTM</pre>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -74,15 +74,12 @@ class AnnotationDrivenCacheBeanDefinitionParser implements BeanDefinitionParser
|
|||
|
||||
/**
|
||||
* Registers a
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="cacheAspect" class="org.springframework.cache.aspectj.AnnotationCacheAspect" factory-method="aspectOf">
|
||||
* <property name="cacheManager" ref="cacheManager"/>
|
||||
* <property name="keyGenerator" ref="keyGenerator"/>
|
||||
* </bean>
|
||||
*
|
||||
* </pre>
|
||||
* @param element
|
||||
* @param parserContext
|
||||
*/
|
||||
private void registerCacheAspect(Element element, ParserContext parserContext) {
|
||||
if (!parserContext.getRegistry().containsBeanDefinition(CACHE_ASPECT_BEAN_NAME)) {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ import org.springframework.util.Assert;
|
|||
*
|
||||
* <p>Usage example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
* XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx);
|
||||
* xmlReader.loadBeanDefinitions(new ClassPathResource("applicationContext.xml"));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.springframework.util.ClassUtils;
|
|||
* <p><b>NOTE:</b> On JBoss 6.0, to avoid the container loading the classes before the
|
||||
* application actually starts, one needs to add a <tt>WEB-INF/jboss-scanning.xml</tt>
|
||||
* file to the application archive - with the following content:
|
||||
* <pre><scanning xmlns="urn:jboss:scanning:1.0"/></pre>
|
||||
* <pre class="code"><scanning xmlns="urn:jboss:scanning:1.0"/></pre>
|
||||
*
|
||||
* <p>Thanks to Ales Justin and Marius Bogoevici for the initial prototype.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.springframework.aop.TargetSource;
|
|||
*
|
||||
* <p>Example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="queueConnectionFactoryTarget" class="org.springframework.jndi.JndiObjectTargetSource">
|
||||
* <property name="jndiName" value="JmsQueueConnectionFactory"/>
|
||||
* <property name="lookupOnStartup" value="false"/>
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ public final class Handle {
|
|||
* Returns the textual representation of this handle. The textual
|
||||
* representation is:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* owner '.' name desc ' ' '(' tag ')'
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ public abstract class MethodVisitor {
|
|||
* constant types, implementations of this method should check for
|
||||
* unexpected constant types, like this:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* if (cst instanceof Integer) {
|
||||
* // ...
|
||||
* } else if (cst instanceof Float) {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public abstract class GenericTypeResolver {
|
|||
* method for {@code creatProxy()} and an {@code Object[]} array containing
|
||||
* {@code MyService.class}, {@code resolveReturnTypeForGenericMethod()} will
|
||||
* infer that the target return type is {@code MyService}.
|
||||
* <pre>{@code public static <T> T createProxy(Class<T> clazz)}</pre>
|
||||
* <pre class="code">{@code public static <T> T createProxy(Class<T> clazz)}</pre>
|
||||
* <h4>Possible Return Values</h4>
|
||||
* <ul>
|
||||
* <li>the target return type, if it can be inferred</li>
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public interface Environment extends PropertyResolver {
|
|||
* explicit active profiles, whether one or more of the given profiles is included in
|
||||
* the set of default profiles. If a profile begins with '!' the logic is inverted,
|
||||
* i.e. the method will return true if the given profile is <em>not</em> active. For
|
||||
* example, <pre>env.acceptsProfiles("p1", "!p2")</pre> will return true if profile
|
||||
* example, <pre class="code">env.acceptsProfiles("p1", "!p2")</pre> will return true if profile
|
||||
* 'p1' is active or 'p2' is not active.
|
||||
* @throws IllegalArgumentException if called with zero arguments
|
||||
* @throws IllegalArgumentException if any profile is null, empty or whitespace-only
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ import org.springframework.util.StringUtils;
|
|||
* <p><b>Ant-style Patterns:</b>
|
||||
*
|
||||
* <p>When the path location contains an Ant-style pattern, e.g.:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* /WEB-INF/*-context.xml
|
||||
* com/mycompany/**/applicationContext.xml
|
||||
* file:C:/some/path/*-context.xml
|
||||
|
|
@ -143,9 +143,9 @@ import org.springframework.util.StringUtils;
|
|||
*
|
||||
* <p><b>WARNING:</b> Ant-style patterns with "classpath:" resources are not
|
||||
* guaranteed to find matching resources if the root package to search is available
|
||||
* in multiple class path locations. This is because a resource such as<pre>
|
||||
* in multiple class path locations. This is because a resource such as<pre class="code">
|
||||
* com/mycompany/package1/service-context.xml
|
||||
* </pre>may be in only one location, but when a path such as<pre>
|
||||
* </pre>may be in only one location, but when a path such as<pre class="code">
|
||||
* classpath:com/mycompany/**/service-context.xml
|
||||
* </pre>is used to try to resolve it, the resolver will work off the (first) URL
|
||||
* returned by {@code getResource("com/mycompany");}. If this base package
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public abstract class StringUtils {
|
|||
/**
|
||||
* Check that the given CharSequence is neither {@code null} nor of length 0.
|
||||
* Note: Will return {@code true} for a CharSequence that purely consists of whitespace.
|
||||
* <p><pre>
|
||||
* <p><pre class="code">
|
||||
* StringUtils.hasLength(null) = false
|
||||
* StringUtils.hasLength("") = false
|
||||
* StringUtils.hasLength(" ") = true
|
||||
|
|
@ -116,7 +116,7 @@ public abstract class StringUtils {
|
|||
* Check whether the given CharSequence has actual text.
|
||||
* More specifically, returns {@code true} if the string not {@code null},
|
||||
* its length is greater than 0, and it contains at least one non-whitespace character.
|
||||
* <p><pre>
|
||||
* <p><pre class="code">
|
||||
* StringUtils.hasText(null) = false
|
||||
* StringUtils.hasText("") = false
|
||||
* StringUtils.hasText(" ") = false
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public interface ExpressionParser {
|
|||
/**
|
||||
* Parse the expression string and return an Expression object you can use for repeated evaluation.
|
||||
* <p>Some examples:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* 3 + 4
|
||||
* name.firstName
|
||||
* </pre>
|
||||
|
|
@ -42,7 +42,7 @@ public interface ExpressionParser {
|
|||
/**
|
||||
* Parse the expression string and return an Expression object you can use for repeated evaluation.
|
||||
* <p>Some examples:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* 3 + 4
|
||||
* name.firstName
|
||||
* </pre>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public interface ParserContext {
|
|||
* Whether or not the expression being parsed is a template. A template expression consists of literal text that can
|
||||
* be mixed with evaluatable blocks. Some examples:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* Some literal text
|
||||
* Hello #{name.firstName}!
|
||||
* #{3 + 4}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import java.text.MessageFormat;
|
|||
* <p>
|
||||
* When a message is formatted, it will have this kind of form
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* EL1004E: (pos 34): Type cannot be found 'String'
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
|
|||
* A builder that provides a convenient API for constructing an embedded database.
|
||||
*
|
||||
* <p>Usage example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
|
||||
* EmbeddedDatabase db = builder.setType(H2).addScript("schema.sql").addScript("data.sql").build();
|
||||
* db.shutdown();
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
|||
* DataSources are defined as individual Spring beans with names
|
||||
* "myRepeatableReadDataSource", "mySerializableDataSource" and "myDefaultDataSource":
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="dataSourceRouter" class="org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter">
|
||||
* <property name="targetDataSources">
|
||||
* <map>
|
||||
|
|
@ -57,7 +57,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
|||
* names for a standard JNDI lookup. This allows for a single concise definition
|
||||
* without the need for separate DataSource bean definitions.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="dataSourceRouter" class="org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter">
|
||||
* <property name="targetDataSources">
|
||||
* <map>
|
||||
|
|
@ -74,7 +74,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
|||
* (By default, JtaTransactionManager will only accept a default isolation level
|
||||
* because of the lack of isolation level support in standard JTA itself.)
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
|
||||
* <property name="allowCustomIsolationLevels" value="true"/>
|
||||
* </bean></pre>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import org.springframework.beans.factory.InitializingBean;
|
|||
* definition, as the list element for the "filterDefinitions" bean property.
|
||||
* For example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
||||
* ...
|
||||
* <property name="filterDefinitions">
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
|||
* Hibernate's own {@code SessionFactory.getCurrentSession()} method, to be
|
||||
* able to detect a thread-bound Session. Typically, the code will look like as follows:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* public void doSomeDataAccessAction() {
|
||||
* Session session = this.sessionFactory.getCurrentSession();
|
||||
* ...
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implemen
|
|||
* This configuration setting corresponds to the <class-cache> entry
|
||||
* in the "hibernate.cfg.xml" configuration format.
|
||||
* <p>For example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <property name="entityCacheStrategies">
|
||||
* <props>
|
||||
* <prop key="com.mycompany.Customer">read-write</prop>
|
||||
|
|
@ -465,7 +465,7 @@ public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implemen
|
|||
* This configuration setting corresponds to the <collection-cache> entry
|
||||
* in the "hibernate.cfg.xml" configuration format.
|
||||
* <p>For example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <property name="collectionCacheStrategies">
|
||||
* <props>
|
||||
* <prop key="com.mycompany.Order.items">read-write</prop>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.springframework.beans.factory.InitializingBean;
|
|||
* definition, as list element for the "typeDefinitions" bean property.
|
||||
* For example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
||||
* ...
|
||||
* <property name="typeDefinitions">
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import org.springframework.aop.support.AopUtils;
|
|||
*
|
||||
* <p>Usage example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
||||
* ...
|
||||
* <property name="entityInterceptor">
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ import org.springframework.util.CollectionUtils;
|
|||
*
|
||||
* <p>For example, in case of <a href="http://www.jpox.org">JPOX</a>:
|
||||
*
|
||||
* <p><pre>
|
||||
* <p><pre class="code">
|
||||
* <bean id="persistenceManagerFactory" class="org.jpox.PersistenceManagerFactoryImpl" destroy-method="close">
|
||||
* <property name="connectionFactory" ref="dataSource"/>
|
||||
* <property name="nontransactionalRead" value="true"/>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import org.springframework.web.client.support.RestGatewaySupport;
|
|||
* actual running server.
|
||||
*
|
||||
* <p>Below is an example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* RestTemplate restTemplate = new RestTemplate()
|
||||
* MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate);
|
||||
*
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import org.springframework.util.Assert;
|
|||
*
|
||||
* <p>Below is an example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* static imports:
|
||||
* MockMvcBuilders.*, MockMvcRequestBuilders.*, MockMvcResultMatchers.*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public interface ResultActions {
|
|||
|
||||
/**
|
||||
* Provide an expectation. For example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* static imports: MockMvcRequestBuilders.*, MockMvcResultMatchers.*
|
||||
*
|
||||
* mockMvc.perform(get("/person/1"))
|
||||
|
|
@ -52,7 +52,7 @@ public interface ResultActions {
|
|||
|
||||
/**
|
||||
* Provide a general action. For example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* static imports: MockMvcRequestBuilders.*, MockMvcResultMatchers.*
|
||||
*
|
||||
* mockMvc.perform(get("/form")).andDo(print());
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ package org.springframework.test.web.servlet;
|
|||
*
|
||||
* <p>Example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* static imports: MockMvcRequestBuilders.*, MockMvcResultHandlers.*
|
||||
*
|
||||
* mockMvc.perform(get("/form")).andDo(print());
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ package org.springframework.test.web.servlet;
|
|||
*
|
||||
* <p>Example:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* static imports: MockMvcRequestBuilders.*, MockMvcResultMatchers.*
|
||||
*
|
||||
* mockMvc.perform(get("/form"))
|
||||
|
|
|
|||
|
|
@ -117,14 +117,14 @@ public abstract class MockMvcRequestBuilders {
|
|||
* {@link MvcResult} of the request that started async processing.
|
||||
*
|
||||
* <p>Usage involves performing one request first that starts async processing:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* MvcResult mvcResult = this.mockMvc.perform(get("/1"))
|
||||
* .andExpect(request().asyncStarted())
|
||||
* .andReturn();
|
||||
* </pre>
|
||||
*
|
||||
* <p>And then performing the async dispatch re-using the {@code MvcResult}:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* this.mockMvc.perform(asyncDispatch(mvcResult))
|
||||
* .andExpect(status().isOk())
|
||||
* .andExpect(content().contentType(MediaType.APPLICATION_JSON))
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ public class ContentResultMatchers {
|
|||
|
||||
/**
|
||||
* Assert the response body content with a Hamcrest {@link Matcher}.
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* mockMvc.perform(get("/path"))
|
||||
* .andExpect(content(containsString("text")));
|
||||
* </pre>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import org.springframework.util.Assert;
|
|||
* agnostic of the actual testing framework in use.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @author Juergen Hoeller
|
||||
* @author Juergen Hoellereasymock
|
||||
* @since 2.5
|
||||
*/
|
||||
public class TestContext extends AttributeAccessorSupport {
|
||||
|
|
|
|||
|
|
@ -44,11 +44,11 @@ public abstract class AssertionErrors {
|
|||
* values to be added to the message.
|
||||
*
|
||||
* <p>For example given:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* assertEquals("Response header [" + name + "]", actual, expected);
|
||||
* </pre>
|
||||
* <p>The resulting message is:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* Response header [Accept] expected:<application/json> but was:<text/plain>
|
||||
* </pre>
|
||||
*
|
||||
|
|
@ -76,7 +76,7 @@ public abstract class AssertionErrors {
|
|||
/**
|
||||
* Assert two objects are equal raise an {@link AssertionError} if not.
|
||||
* <p>For example:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* assertEquals("Response header [" + name + "]", actual, expected);
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.springframework.util.CollectionUtils;
|
|||
* interface to map from the current PortletMode to request handler beans.
|
||||
*
|
||||
* <p>The bean configuration for this mapping will look something like this:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="portletModeHandlerMapping" class="org.springframework.web.portlet.handler.PortletModeHandlerMapping">
|
||||
* <property name="portletModeMap">
|
||||
* <map>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ import org.springframework.web.portlet.util.PortletUtils;
|
|||
*
|
||||
* <p><b>Example:</b>
|
||||
*
|
||||
* <pre><bean id="wrappingController" class="org.springframework.web.portlet.mvc.PortletWrappingController">
|
||||
* <pre class="code"><bean id="wrappingController" class="org.springframework.web.portlet.mvc.PortletWrappingController">
|
||||
* <property name="portletClass">
|
||||
* <value>org.springframework.web.portlet.sample.HelloWorldPortlet</value>
|
||||
* </property>
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ import org.springframework.web.context.ServletContextAware;
|
|||
*
|
||||
* <p>A typical TilesConfigurer bean definition looks as follows:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
|
||||
* <property name="definitions">
|
||||
* <list>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import org.springframework.web.util.WebUtils;
|
|||
* <p><b>Example:</b> web.xml, mapping all "/myservlet" requests to a Spring dispatcher.
|
||||
* Also defines a custom "myServlet", but <i>without</i> servlet mapping.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <servlet>
|
||||
* <servlet-name>myServlet</servlet-name>
|
||||
* <servlet-class>mypackage.TestServlet</servlet-class>
|
||||
|
|
@ -59,7 +59,7 @@ import org.springframework.web.util.WebUtils;
|
|||
* configured HandlerInterceptor chain (e.g. an OpenSessionInViewInterceptor).
|
||||
* From the servlet point of view, everything will work as usual.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
* <property name="interceptors">
|
||||
* <list>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
* through the configured HandlerInterceptor chain (e.g. an OpenSessionInViewInterceptor).
|
||||
* From the Struts point of view, everything will work as usual.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
* <property name="interceptors">
|
||||
* <list>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import org.springframework.web.servlet.FlashMap;
|
|||
* automatically propagated to the "output" FlashMap of the current request.
|
||||
*
|
||||
* <p>Example usage in an {@code @Controller}:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* @RequestMapping(value = "/accounts", method = RequestMethod.POST)
|
||||
* public String handle(Account account, BindingResult result, RedirectAttributes redirectAttrs) {
|
||||
* if (result.hasErrors()) {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ import org.springframework.web.util.UriUtils;
|
|||
* is 'false'. When setting the URL value into a variable, escaping is not recommended.
|
||||
*
|
||||
* <p>Example usage:
|
||||
* <pre><spring:url value="/url/path/{variableName}">
|
||||
* <pre class="code"><spring:url value="/url/path/{variableName}">
|
||||
* <spring:param name="variableName" value="more than JSTL c:url" />
|
||||
* </spring:url></pre>
|
||||
* Results in:
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import org.springframework.web.context.ServletContextAware;
|
|||
* The simplest way to use this class is to specify just a "templateLoaderPath";
|
||||
* you do not need any further configuration then.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
|
||||
* <property name="templateLoaderPath"><value>/WEB-INF/freemarker/</value></property>
|
||||
* </bean></pre>
|
||||
|
|
@ -58,7 +58,7 @@ import org.springframework.web.context.ServletContextAware;
|
|||
* reference the "spring.ftl" macro library (contained in this package and thus
|
||||
* in spring.jar) like this:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <#import "/spring.ftl" as spring/>
|
||||
* <@spring.bind "person.age"/>
|
||||
* age is ${spring.status.value}</pre>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import org.springframework.util.CollectionUtils;
|
|||
* view class. For example you might add the following code to your
|
||||
* {@code Controller}:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* Map<String, Object> model = new HashMap<String, Object>();
|
||||
* model.put("format", "pdf");</pre>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public class MappingJackson2JsonView extends AbstractView {
|
|||
/**
|
||||
* Whether to use the default pretty printer 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);
|
||||
* </pre>
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public class MappingJacksonJsonView extends AbstractView {
|
|||
/**
|
||||
* Whether to use the default pretty printer 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);
|
||||
* </pre>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ import org.springframework.web.context.ServletContextAware;
|
|||
*
|
||||
* <p>A typical TilesConfigurer bean definition looks as follows:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
|
||||
* <property name="definitions">
|
||||
* <list>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public interface WebSocketSession {
|
|||
|
||||
/**
|
||||
* Close the WebSocket connection with status 1000, i.e. equivalent to:
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* session.close(CloseStatus.NORMAL);
|
||||
* </pre>
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue