From 93efb20a53365fea87cf3ef422f06959fcf9c313 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 28 Sep 2021 13:34:33 +0200 Subject: [PATCH] Fix broken links in Javadoc This commit removes several links that were broken due to the removal of various APIs in 6.0. See gh-27480 --- .../concurrent/ConcurrentMapCacheManager.java | 5 +- .../scheduling/SchedulingAwareRunnable.java | 9 +- .../scheduling/SchedulingTaskExecutor.java | 5 +- .../core/ConfigurableObjectInputStream.java | 8 +- .../springframework/core/io/VfsResource.java | 3 +- .../org/springframework/core/io/VfsUtils.java | 7 +- .../core/task/SimpleAsyncTaskExecutor.java | 3 +- .../DefaultMessageListenerContainer.java | 10 +- .../SimpleMessageListenerContainer.java | 3 +- .../support/converter/MessageConverter.java | 4 +- .../GenericMessageEndpointManager.java | 126 +++++++++--------- .../support/LocalConnectionFactoryBean.java | 8 +- .../json/Jackson2ObjectMapperFactoryBean.java | 80 ++++++----- .../web/HttpRequestHandler.java | 10 +- .../support/HttpRequestHandlerServlet.java | 9 +- .../web/multipart/MultipartFile.java | 3 - .../MultipartHttpServletRequest.java | 3 +- .../web/multipart/MultipartResolver.java | 7 +- .../AbstractMultipartHttpServletRequest.java | 6 +- .../DefaultMultipartHttpServletRequest.java | 4 +- .../StandardServletMultipartResolver.java | 19 +-- .../web/servlet/DispatcherServlet.java | 7 +- .../ViewResolversBeanDefinitionParser.java | 5 +- .../WebSphereRequestUpgradeStrategy.java | 4 +- 24 files changed, 150 insertions(+), 198 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java b/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java index aea913288d..8a29d1fd29 100644 --- a/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java +++ b/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,7 @@ import org.springframework.lang.Nullable; *

Note: This is by no means a sophisticated CacheManager; it comes with no * cache configuration options. However, it may be useful for testing or simple * caching scenarios. For advanced local caching needs, consider - * {@link org.springframework.cache.jcache.JCacheCacheManager}, - * {@link org.springframework.cache.ehcache.EhCacheCacheManager}, + * {@link org.springframework.cache.jcache.JCacheCacheManager} or * {@link org.springframework.cache.caffeine.CaffeineCacheManager}. * * @author Juergen Hoeller diff --git a/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java b/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java index d6de8c160a..09a54d2f44 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java +++ b/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,22 +17,17 @@ package org.springframework.scheduling; /** - * Extension of the Runnable interface, adding special callbacks + * Extension of the {@link Runnable} interface, adding special callbacks * for long-running operations. * - *

This interface closely corresponds to the CommonJ Work interface, - * but is kept separate to avoid a required CommonJ dependency. - * *

Scheduling-capable TaskExecutors are encouraged to check a submitted * Runnable, detecting whether this interface is implemented and reacting * as appropriately as they are able to. * * @author Juergen Hoeller * @since 2.0 - * @see commonj.work.Work * @see org.springframework.core.task.TaskExecutor * @see SchedulingTaskExecutor - * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ public interface SchedulingAwareRunnable extends Runnable { diff --git a/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java index 2f1dd004ae..7f7d497eb1 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import org.springframework.core.task.AsyncTaskExecutor; * *

Note: {@link SchedulingTaskExecutor} implementations are encouraged to also * implement the {@link org.springframework.core.task.AsyncListenableTaskExecutor} - * interface. This is not required due to the dependency on Spring 4.0's new + * interface. This is not required due to the dependency on Spring 4.0's * {@link org.springframework.util.concurrent.ListenableFuture} interface, * which would make it impossible for third-party executor implementations * to remain compatible with both Spring 4.0 and Spring 3.x. @@ -37,7 +37,6 @@ import org.springframework.core.task.AsyncTaskExecutor; * @since 2.0 * @see SchedulingAwareRunnable * @see org.springframework.core.task.TaskExecutor - * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ public interface SchedulingTaskExecutor extends AsyncTaskExecutor { diff --git a/spring-core/src/main/java/org/springframework/core/ConfigurableObjectInputStream.java b/spring-core/src/main/java/org/springframework/core/ConfigurableObjectInputStream.java index 52c11eeddf..eb845e4797 100644 --- a/spring-core/src/main/java/org/springframework/core/ConfigurableObjectInputStream.java +++ b/spring-core/src/main/java/org/springframework/core/ConfigurableObjectInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,12 +26,12 @@ import org.springframework.lang.Nullable; import org.springframework.util.ClassUtils; /** - * Special ObjectInputStream subclass that resolves class names - * against a specific ClassLoader. Serves as base class for - * {@link org.springframework.remoting.rmi.CodebaseAwareObjectInputStream}. + * Special {@link ObjectInputStream} subclass that resolves class names + * against a specific {@link ClassLoader}. * * @author Juergen Hoeller * @since 2.5.5 + * @see org.springframework.core.serializer.DefaultDeserializer */ public class ConfigurableObjectInputStream extends ObjectInputStream { diff --git a/spring-core/src/main/java/org/springframework/core/io/VfsResource.java b/spring-core/src/main/java/org/springframework/core/io/VfsResource.java index 6751d60e69..5caf8c5ff0 100644 --- a/spring-core/src/main/java/org/springframework/core/io/VfsResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/VfsResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ import org.springframework.util.Assert; * @author Costin Leau * @author Sam Brannen * @since 3.0 - * @see org.jboss.vfs.VirtualFile */ public class VfsResource extends AbstractResource { diff --git a/spring-core/src/main/java/org/springframework/core/io/VfsUtils.java b/spring-core/src/main/java/org/springframework/core/io/VfsUtils.java index c2e3c3537a..1dad62fb18 100644 --- a/spring-core/src/main/java/org/springframework/core/io/VfsUtils.java +++ b/spring-core/src/main/java/org/springframework/core/io/VfsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,8 +35,9 @@ import org.springframework.util.ReflectionUtils; * (package {@code org.jboss.vfs}) and is in particular compatible with * JBoss AS 7 and WildFly 8+. * - *

Thanks go to Marius Bogoevici for the initial patch. - * Note: This is an internal class and should not be used outside the framework. + *

Thanks go to Marius Bogoevici for the initial implementation. + * + *

Note: This is an internal class and should not be used outside the framework. * * @author Costin Leau * @author Juergen Hoeller diff --git a/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java b/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java index fe0104f589..035e873177 100644 --- a/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java +++ b/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,6 @@ import org.springframework.util.concurrent.ListenableFutureTask; * @see #setConcurrencyLimit * @see SyncTaskExecutor * @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ @SuppressWarnings("serial") public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator diff --git a/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java b/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java index 41fc11034f..4f2435ff5c 100644 --- a/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java +++ b/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java @@ -62,11 +62,10 @@ import org.springframework.util.backoff.FixedBackOff; * abstraction. By default, the specified number of invoker tasks will be created * on startup, according to the {@link #setConcurrentConsumers "concurrentConsumers"} * setting. Specify an alternative {@code TaskExecutor} to integrate with an existing - * thread pool facility (such as a Jakarta EE server's), for example using a - * {@link org.springframework.scheduling.commonj.WorkManagerTaskExecutor CommonJ WorkManager}. - * With a native JMS setup, each of those listener threads is going to use a - * cached JMS {@code Session} and {@code MessageConsumer} (only refreshed in case - * of failure), using the JMS provider's resources as efficiently as possible. + * thread pool facility (such as a Jakarta EE server's). With a native JMS setup, + * each of those listener threads is going to use a cached JMS {@code Session} and + * {@code MessageConsumer} (only refreshed in case of failure), using the JMS provider's + * resources as efficiently as possible. * *

Message reception and listener execution can automatically be wrapped * in transactions by passing a Spring @@ -224,7 +223,6 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe * will occupy a number of threads for its entire lifetime. * @see #setConcurrentConsumers * @see org.springframework.core.task.SimpleAsyncTaskExecutor - * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = taskExecutor; diff --git a/spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java b/spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java index b45de7781a..12e4eba045 100644 --- a/spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java +++ b/spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -177,7 +177,6 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta * {@link jakarta.jms.MessageListener} will work fine, in general. * @see #setConcurrentConsumers * @see org.springframework.core.task.SimpleAsyncTaskExecutor - * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = taskExecutor; diff --git a/spring-jms/src/main/java/org/springframework/jms/support/converter/MessageConverter.java b/spring-jms/src/main/java/org/springframework/jms/support/converter/MessageConverter.java index 433123d195..23b1bdb2e8 100644 --- a/spring-jms/src/main/java/org/springframework/jms/support/converter/MessageConverter.java +++ b/spring-jms/src/main/java/org/springframework/jms/support/converter/MessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,8 +31,6 @@ import jakarta.jms.Session; * @since 1.1 * @see org.springframework.jms.core.JmsTemplate#setMessageConverter * @see org.springframework.jms.listener.adapter.MessageListenerAdapter#setMessageConverter - * @see org.springframework.jms.remoting.JmsInvokerClientInterceptor#setMessageConverter - * @see org.springframework.jms.remoting.JmsInvokerServiceExporter#setMessageConverter */ public interface MessageConverter { diff --git a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java index 090c2a20a5..97e0369ef1 100644 --- a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java +++ b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,21 +39,22 @@ import org.springframework.util.Assert; * *

  * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
- * 	 <property name="resourceAdapter" ref="resourceAdapter"/>
- * 	 <property name="messageEndpointFactory">
- *     <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
- *       <property name="messageListener" ref="messageListener"/>
- *     </bean>
- * 	 </property>
- * 	 <property name="activationSpec">
- *     <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
- *       <property name="destination" value="myQueue"/>
- *       <property name="destinationType" value="jakarta.jms.Queue"/>
- *     </bean>
- *   </property>
- * </bean>
+ * <property name="resourceAdapter" ref="resourceAdapter"/> + * <property name="messageEndpointFactory"> + * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> + * <property name="messageListener" ref="messageListener"/> + * </bean> + * </property> + * <property name="activationSpec"> + * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> + * <property name="destination" value="myQueue"/> + * <property name="destinationType" value="jakarta.jms.Queue"/> + * </bean> + * </property> + * </bean> + * * - * In this example, Spring's own {@link GenericMessageEndpointFactory} is used + *

In this example, Spring's own {@link GenericMessageEndpointFactory} is used * to point to a standard message listener object that happens to be supported * by the specified target ResourceAdapter: in this case, a JMS * {@link jakarta.jms.MessageListener} object as supported by the ActiveMQ @@ -61,37 +62,38 @@ import org.springframework.util.Assert; * *

  * <bean id="messageListener" class="com.myorg.messaging.myMessageListener">
- *   ...
- * </bean>
+ * <!-- ... --> + * </bean> + * * - * The target ResourceAdapter may be configured as a local Spring bean as well + *

The target ResourceAdapter may be configured as a local Spring bean as well * (the typical case) or obtained from JNDI (e.g. on WebLogic). For the * example above, a local ResourceAdapter bean could be defined as follows * (matching the "resourceAdapter" bean reference above): * *

  * <bean id="resourceAdapter" class="org.springframework.jca.support.ResourceAdapterFactoryBean">
- *   <property name="resourceAdapter">
- *     <bean class="org.apache.activemq.ra.ActiveMQResourceAdapter">
- *       <property name="serverUrl" value="tcp://localhost:61616"/>
- *     </bean>
- *   </property>
- *   <property name="workManager">
- *     <bean class="org.springframework.jca.work.SimpleTaskWorkManager"/>
- *   </property>
- * </bean>
+ * <property name="resourceAdapter"> + * <bean class="org.apache.activemq.ra.ActiveMQResourceAdapter"> + * <property name="serverUrl" value="tcp://localhost:61616"/> + * </bean> + * </property> + * <property name="workManager"> + * <bean class="..."/> + * </property> + * </bean> + * * - * For a different target resource, the configuration would simply point to a + *

For a different target resource, the configuration would simply point to a * different ResourceAdapter and a different ActivationSpec object (which are * both specific to the resource provider), and possibly a different message * listener (e.g. a CCI {@link jakarta.resource.cci.MessageListener} for a * resource adapter which is based on the JCA Common Client Interface). * *

The asynchronous execution strategy can be customized through the - * "workManager" property on the ResourceAdapterFactoryBean (as shown above). - * Check out {@link org.springframework.jca.work.SimpleTaskWorkManager}'s - * javadoc for its configuration options; alternatively, any other - * JCA-compliant WorkManager can be used (e.g. Geronimo's). + * "workManager" property on the ResourceAdapterFactoryBean as shown above, + * where {@code } should be replaced with configuration for + * any JCA-compliant {@code WorkManager}. * *

Transactional execution is a responsibility of the concrete message endpoint, * as built by the specified MessageEndpointFactory. {@link GenericMessageEndpointFactory} @@ -101,43 +103,45 @@ import org.springframework.util.Assert; * *

  * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
- * 	 <property name="resourceAdapter" ref="resourceAdapter"/>
- * 	 <property name="messageEndpointFactory">
- *     <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
- *       <property name="messageListener" ref="messageListener"/>
- *       <property name="transactionManager" ref="transactionManager"/>
- *     </bean>
- * 	 </property>
- * 	 <property name="activationSpec">
- *     <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
- *       <property name="destination" value="myQueue"/>
- *       <property name="destinationType" value="jakarta.jms.Queue"/>
- *     </bean>
- *   </property>
+ *  <property name="resourceAdapter" ref="resourceAdapter"/>
+ *  <property name="messageEndpointFactory">
+ *    <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
+ *      <property name="messageListener" ref="messageListener"/>
+ *      <property name="transactionManager" ref="transactionManager"/>
+ *    </bean>
+ *  </property>
+ *  <property name="activationSpec">
+ *    <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
+ *      <property name="destination" value="myQueue"/>
+ *      <property name="destinationType" value="jakarta.jms.Queue"/>
+ *    </bean>
+ *  </property>
  * </bean>
  *
- * <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
+ * <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/> + * * - * Alternatively, check out your resource provider's ActivationSpec object, + *

Alternatively, check out your resource provider's ActivationSpec object, * which should support local transactions through a provider-specific config flag, * e.g. ActiveMQActivationSpec's "useRAManagedTransaction" bean property. * *

  * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
- * 	 <property name="resourceAdapter" ref="resourceAdapter"/>
- * 	 <property name="messageEndpointFactory">
- *     <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
- *       <property name="messageListener" ref="messageListener"/>
- *     </bean>
- * 	 </property>
- * 	 <property name="activationSpec">
- *     <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
- *       <property name="destination" value="myQueue"/>
- *       <property name="destinationType" value="jakarta.jms.Queue"/>
- *       <property name="useRAManagedTransaction" value="true"/>
- *     </bean>
- *   </property>
- * </bean>
+ * <property name="resourceAdapter" ref="resourceAdapter"/> + * <property name="messageEndpointFactory"> + * <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory"> + * <property name="messageListener" ref="messageListener"/> + * </bean> + * </property> + * <property name="activationSpec"> + * <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> + * <property name="destination" value="myQueue"/> + * <property name="destinationType" value="jakarta.jms.Queue"/> + * <property name="useRAManagedTransaction" value="true"/> + * </bean> + * </property> + * </bean> + * * * @author Juergen Hoeller * @since 2.5 diff --git a/spring-tx/src/main/java/org/springframework/jca/support/LocalConnectionFactoryBean.java b/spring-tx/src/main/java/org/springframework/jca/support/LocalConnectionFactoryBean.java index fe49bafdf5..2a514d2a32 100644 --- a/spring-tx/src/main/java/org/springframework/jca/support/LocalConnectionFactoryBean.java +++ b/spring-tx/src/main/java/org/springframework/jca/support/LocalConnectionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,9 +57,8 @@ import org.springframework.lang.Nullable; * order to make the connector interact with an XA transaction coordinator. * Alternatively, simply use the native local transaction facilities of the * exposed API (e.g. CCI local transactions), or use a corresponding - * implementation of Spring's PlatformTransactionManager SPI - * (e.g. {@link org.springframework.jca.cci.connection.CciLocalTransactionManager}) - * to drive local transactions. + * implementation of Spring's PlatformTransactionManager SPI to drive local + * transactions. * * @author Juergen Hoeller * @since 1.2 @@ -67,7 +66,6 @@ import org.springframework.lang.Nullable; * @see #setConnectionManager * @see jakarta.resource.cci.ConnectionFactory * @see jakarta.resource.cci.Connection#getLocalTransaction - * @see org.springframework.jca.cci.connection.CciLocalTransactionManager */ public class LocalConnectionFactoryBean implements FactoryBean, InitializingBean { diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java index 08f89e9ac7..adc81d96b1 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java @@ -62,54 +62,51 @@ import org.springframework.lang.Nullable; *

Example usage with * {@link MappingJackson2HttpMessageConverter}: * - *

{@code
- * 
- *   
- *     
+ * <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
+ *   <property name="objectMapper">
+ *     <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean"
  *       p:autoDetectFields="false"
  *       p:autoDetectGettersSetters="false"
- *       p:annotationIntrospector-ref="jaxbAnnotationIntrospector" />
- *   
- * 
- * }
+ * p:annotationIntrospector-ref="jaxbAnnotationIntrospector" /> + * </property> + * </bean> * *

Example usage with MappingJackson2JsonView: * - *

{@code
- * 
- *   
- *     
+ * <bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
+ *   <property name="objectMapper">
+ *     <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean"
  *       p:failOnEmptyBeans="false"
- *       p:indentOutput="true">
- *       
- *         
- *           
- *         
- *       
- *     
- *   
- * 
- * }
+ * p:indentOutput="true"> + * <property name="serializers"> + * <array> + * <bean class="org.mycompany.MyCustomSerializer" /> + * </array> + * </property> + * </bean> + * </property> + * </bean> * *

In case there are no specific setters provided (for some rarely used options), * you can still use the more general methods {@link #setFeaturesToEnable} and * {@link #setFeaturesToDisable}. * - *

{@code
- * 
- *   
- *     
- *       
- *       
- *     
- *   
- *   
- *     
- *       
- *     
- *   
- * 
- * }
+ *
+ * <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
+ *   <property name="featuresToEnable">
+ *     <array>
+ *       <util:constant static-field="com.fasterxml.jackson.databind.SerializationFeature.WRAP_ROOT_VALUE"/>
+ *       <util:constant static-field="com.fasterxml.jackson.databind.SerializationFeature.CLOSE_CLOSEABLE"/>
+ *     </array>
+ *   </property>
+ *   <property name="featuresToDisable">
+ *     <array>
+ *       <util:constant static-field="com.fasterxml.jackson.databind.MapperFeature.USE_ANNOTATIONS"/>
+ *     </array>
+ *   </property>
+ * </bean>
* *

It also automatically registers the following well-known modules if they are * detected on the classpath: @@ -127,11 +124,10 @@ import org.springframework.lang.Nullable; *

In case you want to configure Jackson's {@link ObjectMapper} with a custom {@link Module}, * you can register one or more such Modules by class name via {@link #setModulesToInstall}: * - *

{@code
- * 
- *   
- * 
+ * 
+ * <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
+ *   <property name="modulesToInstall" value="myapp.jackson.MySampleModule,myapp.jackson.MyOtherModule"/>
+ * </bean>
* *

Compatible with Jackson 2.9 to 2.12, as of Spring 5.3. * diff --git a/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java b/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java index 542e608094..94b155c3c3 100644 --- a/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java +++ b/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,12 +49,6 @@ import jakarta.servlet.http.HttpServletResponse; * return value gives a clearer signature to callers other than the * DispatcherServlet, indicating that there will never be a view to render. * - *

As of Spring 2.0, Spring's HTTP-based remote exporters, such as - * {@link org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter} - * and {@link org.springframework.remoting.caucho.HessianServiceExporter}, - * implement this interface rather than the more extensive Controller interface, - * for minimal dependencies on Spring-specific web infrastructure. - * *

Note that HttpRequestHandlers may optionally implement the * {@link org.springframework.web.servlet.mvc.LastModified} interface, * just like Controllers can, provided that they run within Spring's @@ -71,8 +65,6 @@ import jakarta.servlet.http.HttpServletResponse; * @see org.springframework.web.servlet.mvc.Controller * @see org.springframework.web.servlet.mvc.LastModified * @see org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter - * @see org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter - * @see org.springframework.remoting.caucho.HessianServiceExporter */ @FunctionalInterface public interface HttpRequestHandler { diff --git a/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java b/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java index a97b402c36..958559b6d6 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,13 +36,6 @@ import org.springframework.web.context.WebApplicationContext; * in Spring's root web application context. The target bean name must match the * HttpRequestHandlerServlet servlet-name as defined in {@code web.xml}. * - *

This can for example be used to expose a single Spring remote exporter, - * such as {@link org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter} - * or {@link org.springframework.remoting.caucho.HessianServiceExporter}, - * per HttpRequestHandlerServlet definition. This is a minimal alternative - * to defining remote exporters as beans in a DispatcherServlet context - * (with advanced mapping and interception facilities being available there). - * * @author Juergen Hoeller * @since 2.0 * @see org.springframework.web.HttpRequestHandler diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java index 725bbfc0dc..25790e5f3d 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java @@ -61,8 +61,6 @@ public interface MultipartFile extends InputStreamSource { * this one one somewhere for reference, if necessary. * @return the original filename, or the empty String if no file has been chosen * in the multipart form, or {@code null} if not defined or not available - * @see org.apache.commons.fileupload.FileItem#getName() - * @see org.springframework.web.multipart.commons.CommonsMultipartFile#setPreserveFilename * @see RFC 7578, Section 4.2 * @see Unrestricted File Upload */ @@ -133,7 +131,6 @@ public interface MultipartFile extends InputStreamSource { * @throws IOException in case of reading or writing errors * @throws IllegalStateException if the file has already been moved * in the filesystem and is not available anymore for another transfer - * @see org.apache.commons.fileupload.FileItem#write(File) * @see jakarta.servlet.http.Part#write(String) */ void transferTo(File dest) throws IOException, IllegalStateException; diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartHttpServletRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartHttpServletRequest.java index 692dd710d2..0fa6a8b726 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartHttpServletRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartHttpServletRequest.java @@ -25,7 +25,8 @@ import org.springframework.lang.Nullable; /** * Provides additional methods for dealing with multipart content within a * servlet request, allowing to access uploaded files. - * Implementations also need to override the standard + * + *

Implementations also need to override the standard * {@link jakarta.servlet.ServletRequest} methods for parameter access, making * multipart parameters available. * diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java index cd18292d26..a9c79dfbb8 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,8 @@ import jakarta.servlet.http.HttpServletRequest; * Implementations are typically usable both within an application context * and standalone. * - *

There are two concrete implementations included in Spring, as of Spring 3.1: + *

Spring provides the following concrete implementation: *

    - *
  • {@link org.springframework.web.multipart.commons.CommonsMultipartResolver} - * for Apache Commons FileUpload *
  • {@link org.springframework.web.multipart.support.StandardServletMultipartResolver} * for the Servlet 3.0+ Part API *
@@ -77,7 +75,6 @@ import jakarta.servlet.http.HttpServletRequest; * @since 29.09.2003 * @see MultipartHttpServletRequest * @see MultipartFile - * @see org.springframework.web.multipart.commons.CommonsMultipartResolver * @see org.springframework.web.multipart.support.ByteArrayMultipartFileEditor * @see org.springframework.web.multipart.support.StringMultipartFileEditor * @see org.springframework.web.servlet.DispatcherServlet diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/AbstractMultipartHttpServletRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/support/AbstractMultipartHttpServletRequest.java index 8504b96816..fb705a9445 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/AbstractMultipartHttpServletRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/AbstractMultipartHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,8 +34,8 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; /** - * Abstract base implementation of the MultipartHttpServletRequest interface. - * Provides management of pre-generated MultipartFile instances. + * Abstract base implementation of the {@link MultipartHttpServletRequest} interface. + *

Provides management of pre-generated {@link MultipartFile} instances. * * @author Juergen Hoeller * @author Arjen Poutsma diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java index 3a7859e561..3ac4ddeed7 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,8 +35,6 @@ import org.springframework.web.multipart.MultipartFile; * {@link org.springframework.web.multipart.MultipartHttpServletRequest} * interface. Provides management of pre-generated parameter values. * - *

Used by {@link org.springframework.web.multipart.commons.CommonsMultipartResolver}. - * * @author Trevor D. Cook * @author Juergen Hoeller * @author Arjen Poutsma diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java index 3a29473a4a..b09dac0ba2 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java @@ -34,11 +34,8 @@ import org.springframework.web.multipart.MultipartResolver; * *

This resolver variant uses your Servlet container's multipart parser as-is, * potentially exposing the application to container implementation differences. - * See {@link org.springframework.web.multipart.commons.CommonsMultipartResolver} - * for an alternative implementation using a local Commons FileUpload library - * within the application, providing maximum portability across Servlet containers. * Also, see this resolver's configuration option for - * {@link #setStrictServletCompliance strict Servlet compliance}, narrowing the + * {@linkplain #setStrictServletCompliance strict Servlet compliance}, narrowing the * applicability of Spring's {@link MultipartHttpServletRequest} to form data only. * *

Note: In order to use Servlet 3.0 based multipart parsing, @@ -52,21 +49,19 @@ import org.springframework.web.multipart.MultipartResolver; * *

  * public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
- *	 // ...
- *	 @Override
- *	 protected void customizeRegistration(ServletRegistration.Dynamic registration) {
+ *   // ...
+ *   @Override
+ *   protected void customizeRegistration(ServletRegistration.Dynamic registration) {
  *     // Optionally also set maxFileSize, maxRequestSize, fileSizeThreshold
  *     registration.setMultipartConfig(new MultipartConfigElement("/tmp"));
  *   }
- * }
- * 
+ * }
* * @author Juergen Hoeller * @since 3.1 * @see #setResolveLazily * @see #setStrictServletCompliance * @see HttpServletRequest#getParts() - * @see org.springframework.web.multipart.commons.CommonsMultipartResolver */ public class StandardServletMultipartResolver implements MultipartResolver { @@ -99,10 +94,6 @@ public class StandardServletMultipartResolver implements MultipartResolver { * switch this flag to "true": Only "multipart/form-data" requests will be * wrapped with a {@link MultipartHttpServletRequest} then; other kinds of * requests will be left as-is, allowing for custom processing in user code. - *

Note that Commons FileUpload and therefore - * {@link org.springframework.web.multipart.commons.CommonsMultipartResolver} - * supports any "multipart/" request type. However, it restricts processing - * to POST requests which standard Servlet multipart parsers might not do. * @since 5.3.9 */ public void setStrictServletCompliance(boolean strictServletCompliance) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java index 45ee3a9bc5..de87a28f47 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java @@ -117,10 +117,9 @@ import org.springframework.web.util.WebUtils; * {@link org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator}. * *

  • The dispatcher's strategy for resolving multipart requests is determined by a - * {@link org.springframework.web.multipart.MultipartResolver} implementation. - * Implementations for Apache Commons FileUpload and Servlet 3 are included; the typical - * choice is {@link org.springframework.web.multipart.commons.CommonsMultipartResolver}. - * The MultipartResolver bean name is "multipartResolver"; default is none. + * {@link org.springframework.web.multipart.MultipartResolver} implementation. An + * implementation for Servlet 3 is included. The MultipartResolver bean name is + * "multipartResolver"; default is none. * *
  • Its locale resolution strategy is determined by a {@link LocaleResolver}. * Out-of-the-box implementations work via HTTP accept header, cookie, or session. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewResolversBeanDefinitionParser.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewResolversBeanDefinitionParser.java index 421d7c182c..e6cd60308c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewResolversBeanDefinitionParser.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewResolversBeanDefinitionParser.java @@ -39,7 +39,7 @@ import org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver; import org.springframework.web.servlet.view.script.ScriptTemplateViewResolver; /** - * Parse the {@code view-resolvers} MVC namespace element and register + * Parses the {@code view-resolvers} MVC namespace element and registers * {@link org.springframework.web.servlet.ViewResolver} bean definitions. * *

    All registered resolvers are wrapped in a single (composite) ViewResolver @@ -49,13 +49,12 @@ import org.springframework.web.servlet.view.script.ScriptTemplateViewResolver; *

    When content negotiation is enabled the order property is set to highest priority * instead with the ContentNegotiatingViewResolver encapsulating all other registered * view resolver instances. That way the resolvers registered through the MVC namespace - * form self-encapsulated resolver chain. + * form a self-encapsulated resolver chain. * * @author Sivaprasad Valluru * @author Sebastien Deleuze * @author Rossen Stoyanchev * @since 4.1 - * @see TilesConfigurerBeanDefinitionParser * @see FreeMarkerConfigurerBeanDefinitionParser * @see GroovyMarkupConfigurerBeanDefinitionParser * @see ScriptTemplateConfigurerBeanDefinitionParser diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/WebSphereRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/WebSphereRequestUpgradeStrategy.java index 6a69ec0769..24014d4767 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/WebSphereRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/WebSphereRequestUpgradeStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import org.springframework.web.socket.server.HandshakeFailureException; /** * WebSphere support for upgrading an {@link HttpServletRequest} during a * WebSocket handshake. To modify properties of the underlying - * {@link javax.websocket.server.ServerContainer} you can use + * {@link jakarta.websocket.server.ServerContainer} you can use * {@link ServletServerContainerFactoryBean} in XML configuration or, when using * Java configuration, access the container instance through the * "javax.websocket.server.ServerContainer" ServletContext attribute.