Commit Graph

2251 Commits

Author SHA1 Message Date
Sebastien Deleuze a3fd00eadb Improve @JsonView reference documentation
Issue: SPR-12270
2014-09-30 05:44:51 +02:00
Sam Brannen 38777955d2 Escape single quotes in the reference manual
This commit ensures that single quotes nested in double quotes in
code examples in the reference manual are properly escaped using ''.

Issue: SPR-12246
2014-09-24 19:12:33 +02:00
Sam Brannen 07ffb6ffed Polish SpEL compiler section 2014-09-24 14:12:40 +02:00
Sam Brannen 75291b32bc Fix grammar in @JsonView section 2014-09-24 13:10:31 +02:00
Sam Brannen 2a0fb1b684 Fix broken links to JIRA issues 2014-09-24 13:07:51 +02:00
Sam Brannen b31c95df85 Polish code formatting in testing chapter 2014-09-24 13:04:47 +02:00
Brian Clozel 983b5338ed Fix typo in documentation
Issue: SPR-8025
2014-09-22 18:38:19 +02:00
Brian Clozel ea034aeb2e Reorder list of data access modules in documentation
Issue: SPR-7689
2014-09-22 18:38:19 +02:00
Brian Clozel 09a6afb94c Fix "file:///" URL schema in documentation
Issue:  SPR-7735
2014-09-22 18:38:19 +02:00
Juergen Hoeller 94e26fd72d Remove outdated references to ContextLoaderServlet
Issue: SPR-7725
2014-09-22 17:51:38 +02:00
Rossen Stoyanchev b1e9577680 Ensure single quotes appear in documentation sample
Issue: SPR-12186
2014-09-18 14:52:41 -04:00
Rossen Stoyanchev c9c3857eae Update section on resource handler config
Issue: SPR-14036
2014-09-04 01:13:53 -04:00
Juergen Hoeller 20c2ba35dc Polishing 2014-09-04 00:55:38 +02:00
Rossen Stoyanchev 50846e3288 Update reference 2014-09-03 13:09:24 -04:00
Sebastien Deleuze 06f1f495c2 Update reference documentation for JSONP support
Issue: SPR-12113
2014-09-03 11:25:22 +02:00
Rossen Stoyanchev 7885a5975e Add section on building controller links from views 2014-09-03 00:30:25 -04:00
Rossen Stoyanchev 51a550b27b Add mention of ResponseBodyAdvice 2014-09-03 00:04:50 -04:00
Rossen Stoyanchev 3a8f30613d Update the what's new section 2014-09-03 00:04:49 -04:00
Andy Clement 8bf141eca9 Documentation updates describing SpEL compiler usage 2014-09-02 17:30:54 -07:00
Sam Brannen 1f6c40fd86 Polish recent changes to reference manual 2014-09-02 22:38:20 +02:00
Juergen Hoeller 98eb0f75bc Polishing 2014-09-02 22:15:53 +02:00
Sebastien Deleuze 041479a0d5 Add Web Improvements to what's new in Spring 4.1 section 2014-09-02 15:47:24 +02:00
Brian Clozel 5490168037 List all spring-framework artifacts in Modules
This change adds the artifacts names in the Spring Framework Modules
documentation. Linking both concepts make it easier to decide which
Spring module should be importer in an application's build.

Issue: SPR-11534
2014-09-02 14:34:07 +02:00
Stephane Nicoll fafb2fce2f Improve what's new in Spring 4.1 section 2014-09-01 18:26:59 +02:00
Sam Brannen ede97d99ea Add 'new in Spring 4.1' section to reference manual
This commit introduces a new-in-4.1 section in the reference manual with
initial content for testing improvements.
2014-09-01 03:16:51 +02:00
Sam Brannen 4c2aa6adc6 Document support for merging TELs with defaults
This commit restructures the content of the "TestExecutionListener
registration and ordering" section of the Testing chapter in the
reference manual into cross-referenced subsections with more
appropriate titles.

In addition, this commit introduces a new "Merging
TestExecutionListeners" subsection which documents the new MergeMode
feature in @TestExecutionListeners, including an example demonstrating
the MERGE_WITH_DEFAULTS mode.

Issue: SPR-12083
2014-09-01 02:35:29 +02:00
Sam Brannen 7cd615c4f9 Document automatic discovery of default TELs
This commit introduces a new "TestExecutionListener registration and
ordering" section in the Testing chapter of the reference manual.

Issue: SPR-12082
2014-09-01 01:33:58 +02:00
Sam Brannen 10c5827956 Improve text for xref links in the reference manual 2014-08-31 23:23:16 +02:00
Sam Brannen cdc522242f Document programmatic tx mgt support in the TCF
This commit introduces a new "Programmatic transaction management"
section in the Testing chapter of the reference manual with an example
highlighting the new support provided via TestTransaction.

In addition, this commit begins the work to be addressed more
thoroughly in SPR-11399 by overhauling the entire "Transaction
management" section with in-depth discussions on the following topics.

 - Test-managed transactions
 - Enabling and disabling transactions
 - Transaction rollback and commit behavior
 - Executing code outside of a transaction
 - Configuring a transaction manager

Issue: SPR-11941, SPR-11399
2014-08-31 22:53:43 +02:00
Sam Brannen 9926badb33 Document @TestPropertySource support in the reference manual
This commit introduces a new "Context configuration with test property
sources" section in the Testing chapter of the reference manual.

In addition, the "Context caching" section has been updated regarding
support for test property source locations and properties in
MergedContextConfiguration.

Issue: SPR-12076
2014-08-31 21:05:42 +02:00
Sam Brannen d4f5901f1f Document Groovy script support in the TCF
This commit documents support for using Groovy scripts to load
ApplicationContexts using the Spring TestContext Framework (TCF) in the
reference manual.

Issue: SPR-12027
2014-08-31 19:02:21 +02:00
Sam Brannen 3220d46776 Document @Sql script support in the reference manual
- Introduced a new "Executing SQL scripts" section in the Testing
   chapter with a subsection covering programmatic script execution via
   ResourceDatabasePopulator, ScriptUtils, etc. and a subsection
   dedicated to the new declarative support via @Sql.

 - Documented @Sql, @SqlConfig, and @SqlGroup in the "Annotations" and
   "Meta-annotation" sections.

 - Fixed broken cross-reference links to "false positives" with ORM tip.

 - Documented methods in JdbcTestUtils.

 - Improved layout and information in sections covering
   AbstractTransactionalJUnit4SpringContextTests and
   AbstractTransactionalTestNGSpringContextTests.

Issue: SPR-11849
2014-08-31 17:17:04 +02:00
Sam Brannen 5857cef026 Revise JUnit vs. Spring timeout support in reference manual
Prior to this commit, the discussion of JUnit vs. Spring with regard to
timeout support in tests erroneously claimed that Spring's support for
JUnit's @Test(timeout=...) did not include set up and tear down or
repetitions. This information, however, was based on a previous version
of SpringJUnit4ClassRunner and is no longer valid.

This commit revises the affected section of the testing chapter in the
reference manual accordingly.
2014-08-30 02:03:47 +02:00
Sam Brannen ac164088d6 Fix typos in reference manual
manger --> manager
2014-08-30 01:40:19 +02:00
Stephane Nicoll eee8184b29 Update documentation
This commit updates the documentation to mention that the #result
object is available in the SpEL context for computing the key to use
for a @CachePut operation.

Issue: SPR-12125
2014-08-27 15:31:28 +02:00
Stephane Nicoll 15f496bc2a Document environment abstraction
This commit replace the two empty "chapters" dedicated to profiles
and property source to an 'Environment abstraction' chapter that
covers both.

Issue: SPR-12107
2014-08-25 15:26:26 +02:00
Sebastien Deleuze 6665634675 Support Jackson based XML serialization/deserialization
This commit adds support for XML serialization/deserialization based on
the jackson-dataformat-xml extension. When using @EnableWebMvc or
<mvc:annotation-driven/>, Jackson will be used  by default instead of JAXB2
if jackson-dataformat-xml classes are found in the classpath.

This commit introduces MappingJackson2XmlHttpMessageConverter and
MappingJackson2XmlView classes, and common parts between JSON
and XML processing have been moved to AbstractJackson2HttpMessageConverter
and AbstractJackson2View classes.

MappingJackson2XmlView supports serialization of a single object. If the model
contains multiple entries, MappingJackson2XmlView.setModelKey() should be
used to specify the entry to serialize.

Pretty print works in XML, but tests are not included since a Woodstox dependency
is needed, and it is better to continue testing spring-web and spring-webmvc
against JAXB2.

Issue: SPR-11785
2014-08-13 16:22:58 +02:00
Juergen Hoeller f1f1c4c980 Remove outdated IDE, JIRA and Tomcat references
Issue: SPR-7521
2014-08-12 16:32:20 +02:00
Sebastien Deleuze f56000b825 Replace http by https for spring.io links in the reference documentation 2014-08-12 11:15:55 +02:00
Sebastien Deleuze 01cbf9b9ee Update references to SpringSource in the reference documentation 2014-08-12 10:31:41 +02:00
Stephane Nicoll d100eef829 Cache documentation in multi-threaded environment
Issue: SPR-9588
2014-08-11 16:01:38 +02:00
Stephane Nicoll c0ea87010f Improve destination-type documentation
Issue: SPR-12073
2014-08-11 15:43:45 +02:00
Stephane Nicoll a635c36470 Fix doc typo 2014-08-08 13:17:55 +02:00
Andy Clement 095bd99951 Add support for inline maps in SpEL expressions
This commit introduces the ability to specify an inline map in
an expression. The syntax is similar to inline lists and of
the form: "{key:value,key2:value}". The keys can optionally
be quoted. The documentation is also updated with information
on the syntax.

Issue: SPR-9472
2014-08-06 11:15:11 -07:00
Stephane Nicoll d6b1cdc55f Custom cache annotations and AspectJ
This commit clarifies what should be done in order to use custom cache
annotations with AspectJ.

Issue: SPR-11503
2014-08-04 17:26:01 +02:00
Stephane Nicoll 3c72849ee4 Fix broken link 2014-08-04 14:45:35 +02:00
Stephane Nicoll 59c5d7d1ca Add messaging module section
Issue: SPR-11847
2014-08-04 14:41:52 +02:00
Rossen Stoyanchev fe88b6e054 Add to SockJsClient reference documentation
Issue: SPR-12006
2014-08-01 16:57:13 -04:00
Sebastien Deleuze 28c70baf61 Add documentation for Java SockJS client
Issue: SPR-12006
2014-08-01 16:57:13 -04:00
Rossen Stoyanchev 25decee1a4 Polish 2014-07-31 17:47:24 -04:00
Sebastien Deleuze 87273d1b83 Enrich documentation with details on how to filter messages
Issue: SPR-11952
2014-07-31 17:47:24 -04:00
Rossen Stoyanchev 70ccbbfab1 Fix documentation issue for user destinations
Issue: SPR-11992
2014-07-31 17:12:32 -04:00
Rossen Stoyanchev e4182da4eb Add section on path pattern comparison
Issue: SPR-10576
2014-07-31 16:28:00 -04:00
Rossen Stoyanchev f50cb06dc2 Polish 2014-07-29 17:58:16 -04:00
Sebastien Deleuze 20c9a8bad4 Improve documentation for using "." as destination separator
Issue: SPR-12007
2014-07-29 17:17:40 -04:00
Rossen Stoyanchev 8e38b7ede6 Add section on web security
Issue: SPR-6125
2014-07-29 16:56:37 -04:00
Stephane Nicoll b6389a6c66 Jms request/reply operations
This commit updates JmsMessagingTemplate to support the
MessageRequestReplyOperation interface that provides synchronous
request/reply operations.

As JmsMessagingTemplate delegates everything under the scenes to
JmsTemplate, the latter has been updated as well to offer such lower
level operation.

Issue: SPR-12037
2014-07-28 15:52:50 +02:00
Juergen Hoeller d4fe732f46 Typo fixes and cleanup of outdated Java 5 references
Issue: SPR-12020
2014-07-24 17:00:44 +02:00
Stephane Nicoll db5cebc681 Fix typo 2014-07-23 17:30:15 +02:00
Rossen Stoyanchev 829d204663 MVC config doc updates 2014-07-18 09:18:34 -04:00
Sebastien Deleuze 7412d43acd Update documentation with MVC config view resolution examples
Issue: SPR-11989
2014-07-18 09:18:34 -04:00
Rossen Stoyanchev 29c6c9a375 Add guidance on URI vars and suffix pattern matching
Issue: SPR-11728
2014-07-18 00:41:38 -04:00
Rossen Stoyanchev ab2526a586 Update support for using "." as path separator
Issue: SPR-11660
2014-07-14 18:49:25 -04:00
Stephane Nicoll 29bdbceaa2 Customize concurrency at listener level
Prior to this commit, customizing the concurrency to use fo a given JMS
listener involved to define it in a specific listener-container. As
this is quite restrictive, users may stop using the XML namespace
support altogether to fallback on regular abstract bean definition for
the container.

This commit adds a concurrency attribute to the jms and jca listener
element as well as on the @JmsListener annotation. If the value is set,
it takes precedence; otherwise the value provided by the factory is
used.

Issue: SPR-11988
2014-07-14 15:49:31 +02:00
Rossen Stoyanchev 48236be4a2 STOMP and WebSocket messaging related logging updates
This change removes most logging at INFO level and also ensures the
amount of information logged at DEBUG level is useful, brief, and
not duplicated.

Also added is custom logging for STOMP frames to ensure very readable
and consise output.

Issue: SPR-11934
2014-07-09 00:39:59 -04:00
Rossen Stoyanchev ab4864da2a Add STOMP/WebSocket stats collection
This change adds collection of stats in key infrastructure components
of the WebSocket message broker config setup and exposes the gathered
information for logging and viewing (e.g. via JMX).

WebSocketMessageBrokerStats is a single class that assembles all
gathered information and by default logs it once every 15 minutes.
Application can also easily expose to JMX through an MBeanExporter.

A new section in the reference documentation provides a summary of
the available information.

Issue: SPR-11739
2014-07-09 00:39:47 -04:00
Stephane Nicoll e20ac27fb4 Fix mutually exclusive use of CachePut and Cacheable
Commit eea230f introduced a regression by adding a support for the
"result" variable in SpEL expression for @CachePut. As such expressions
cannot be evaluated upfront anymore, any method that contains both
@Cacheable and @CachePut annotations are always executed even when
their conditions are mutually exclusive.

This is an example of such mutual exclusion

@Cacheable(condition = "#p1", key = "#p0")
@CachePut(condition = "!#p1", key = "#p0")
public Object getFooById(Object id, boolean flag) { ... }

This commit updates CacheEvaluationContext to define a set of
unavailable variables. When such variable is accessed for a given
expression, an exception is thrown. This is used to restore the
evaluation of the @CachePut condition upfront by registering "result"
as an unavailable variable.

If all @CachePut operations have been excluded by this upfront check,
the @Cacheable operation is processed as it was before. Such upfront
check restore the behavior prior to eea230f.

Issue: SPR-11955
2014-07-07 14:18:19 +02:00
Juergen Hoeller b5a5fffdfd Reference documentation covers application scope now
Issue: SPR-11944
2014-07-03 22:26:24 +02:00
Stephane Nicoll 62351e0f6e Fix wrong method signature in documentation
Issue: SPR-11945
2014-07-03 17:00:25 +02:00
Rossen Stoyanchev 1c91a52639 Add STOMP subscribe/unscubscribe ApplicationContext events
Issue: SPR-11813
2014-06-28 11:07:42 -04:00
Juergen Hoeller f966bf683c Explicitly mention BeanPostProcessor declaration requirements with @Bean methods
Issue: SPR-11906
2014-06-25 12:44:17 +02:00
Sam Brannen b4e16eacc5 Require JUnit 4.9 or higher in the TCF
Prior to this commit, the Spring TestContext Framework (TCF) was
compatible with JUnit 4.5 or higher.

This commit effectively raises the minimum version of JUnit that is
officially supported by the TCF to JUnit 4.9, thereby aligning with
similar upgrades made in the Spring Framework 4.0 release (i.e.,
upgrading minimum requirements on third-party libraries to versions
released mid 2010 or later).

Issue: SPR-11908
2014-06-25 10:10:25 +02:00
Brian Clozel cff36d68b1 update documentation with latest forum infos
Forums will be shortly deactivated and questions should take place
in StackOverflow.
2014-06-19 15:33:06 +02:00
Stephane Nicoll 9ba9f562f2 Add @ComponentScan documentation
This commit provides a proper documentation for the @ComponentScan
annotation as a java config alternative to <context:component-scan/>

Issue: SPR-11846
2014-06-11 11:51:10 +02:00
Stephane Nicoll 6b6b008c1f Fix typo
Issue: SPR-11862
2014-06-10 16:51:13 +02:00
Stephane Nicoll 5cc779ab35 Fix callout formatting issue 2014-06-10 10:58:05 +02:00
Stephane Nicoll c7b106577f polishing
Reorganized class structure to match our code style (setter for
properties at the top of the class, public method before private
implementation).

Removed DisposableBean as it the lifecycle is already taking care
of removing MBeans on stop.

Cleaned test suite

Issue: SPR-8045
2014-06-10 10:13:58 +02:00
Juergen Hoeller af4621d996 Reference documentation consistently refers to Apache HttpComponents instead of outdated Commons HttpClient
Includes overhaul of remaining references to J2SE and J2EE, consistently replacing them with "the JDK" and "Java EE".

Issue: SPR-11853
2014-06-07 00:29:09 +02:00
Vasyl Tretiakov abc377603d Reference manual polishing 2014-06-06 07:57:55 +02:00
Stephane Nicoll 05041ff39a Update JMS documentation
This commit updates the JMS documentation regarding the side effects
of not using the  cache with a non durable subscriber.

Issue: SPR-7883
2014-05-26 10:40:32 +02:00
Gildas Cuisinier 8d306bfbc0 fix javadoc link for RestController and PropertySource 2014-05-24 18:29:52 +02:00
Stephane Nicoll 9952973e01 Add missing cache-resolver attribute
Prior to this commit, CacheResolver could not be configured through
the XML namespace (i.e. cache:annotation-driven). This is now the
case.

Issue: SPR-11490
2014-05-21 09:03:18 +02:00
Stephane Nicoll 05e96ee448 Cache provider related exceptions handling
This commit adds the necessary infrastructure to handle exceptions
thrown by a cache provider in both Spring's and JCache's caching
abstractions.

Both interceptors can be configured with a CacheErrorHandler that
defines several callbacks on typical cache operations. In particular,
handleCacheGetError can be implemented in such a way that an
exception thrown by the provider is handled as a cache miss by the
caching abstraction.

The handler can be configured with both CachingConfigurer and the
XML namespace (error-handler property)

Issue: SPR-9275
2014-05-20 16:39:34 +02:00
Stephane Nicoll 7469159bf1 Add MessageSendingOperations for JMS
This commit adds a JMS implementation of MessageSendingOperations,
allowing to send JMS messages using Spring's standard Messaging
abstraction.

MessagingMessageConverter is a standard JMS's MessageConverter that
can convert Spring's Message to JMS message and vice versa. Existing
infrastructure has been updated to use this implementation.

Issue: SPR-11772
2014-05-19 10:46:13 +02:00
Sebastien Deleuze be0b69cbf1 Add support for Jackson serialization views
Spring MVC now supports Jackon's serialization views for rendering
different subsets of the same POJO from different controller
methods (e.g. detailed page vs summary view).

Issue: SPR-7156
2014-05-15 23:03:33 -04:00
Brian Clozel a072b3f20d Fix RestTemplate documentation for gzip encoding
Prior to this commit, RestTemplate's documentation advised to a
DecompressingHttpClient decorator along with Apache's HttpClient in
order to support gzipped responses.

Since this is now deprecated as of Apache HttpClient 4.3+, this commits
update the documentation with HttpClientBuilder.
2014-05-14 18:04:46 +02:00
Rossen Stoyanchev 2c4cbb617e Add WebSocket scope
This change adds support for a custom "websocket" scope.

WebSocket-scoped beans may be injected into controllers with message
handling methods as well as channel interceptor registered on the
"inboundClientChannel".

Issue: SPR-11305
2014-05-11 12:31:17 -04:00
Stephane Nicoll 89fc3c0257 Add BackOffExecution to isolate state
This commit separates the BackOff configuration from an actual
 execution. BackOffExecution now contains all the state of a
 particular execution and BackOff is only meant to start (i.e.
 create) a new execution.

 The method "reset" has been removed as its no longer necessary:
 when an execution does not need to be used for a given operation
 anymore it can be simply discarded.

 Issue: SPR-11746
2014-05-09 16:39:01 +02:00
Stephane Nicoll 49040a2925 Add back-off attribute to JMS namespace
This commit adds a "back-off" attribute to the jms:listener-container
 element so that a BackOff instance can be provided for users of the
 XML namespace.

 Issue: SPR-11746
2014-05-09 15:05:43 +02:00
Rossen Stoyanchev 97fb308b6b Allow use of @SendToUser even w/o authenticated user
Before this change, subscribing to a user destination and use of
@SendToUser annotation required an authenticated user.

This change makes it possible to subscribe to a user destination from
WebSocket sessions without an authenticated user. In such cases the
destination is associated with one session only rather than with a
user (and all their sessions).

It is then also possible to send a message to a user destination
via "/user/{sessionId}/.." rather than "/user/{user}/...".

That means @SendToUser works relying on the session id of the input
message, effectively sending a reply to destination private to the
session.

A key use case for this is handling an exception with an
@MessageExceptionHandler method and sending a reply with @SendToUser.

Issue: SPR-11309
2014-05-08 22:06:57 -04:00
Stephane Nicoll 7b7fe9aa17 JMS documentation update
This commit updates the documentation of the JMS chapter
with the newly annotated endpoint infrastructure
2014-05-07 12:00:29 +02:00
Stephane Nicoll 6551aa61fa Fix typo
Issue: SPR-11571
2014-05-02 09:57:00 +02:00
Rossen Stoyanchev 676282c66e Support ListenableFuture on @RequestMapping methods
Issue: SPR-11695
2014-05-01 12:28:59 -04:00
Rossen Stoyanchev 26a9c4bc01 Polish STOMP documentation 2014-04-28 22:35:10 -04:00
Sebastien Deleuze 59a050f3b9 Include more guidance about DispatcherServlet context
Also update <mvc:annotation-driven /> comment in XSD.

Issue: SPR-11703
2014-04-28 22:07:55 -04:00
Rossen Stoyanchev 86785f340e Document STOMP-related ApplicationContext events
Issue: SPR-11672
2014-04-28 22:02:45 -04:00
Juergen Hoeller 53162e78e4 WebSocket intro correctly points to annotations section
Issue: SPR-11667
2014-04-16 18:07:25 +02:00
Biju Kunjummen 973780efd5 Minor doc fix to sample for @ConstructorProperties 2014-04-15 18:10:46 +02:00
Stephane Nicoll 1f2d5b5d89 Fix typos 2014-04-09 17:35:45 +02:00
Stephane Nicoll 2b89c1a87e Improve cache abstraction chapter
This commit is a general update of the Cache Abstraction chapter.

Existing sections have been updated with recent improvements made in
that area, in particular:
* Guava and JSR-107 caches support
* New @CacheConfig annotation allowing to share some key customizations
  at class-level
* CacheResolver interface used to resolve the cache(s) to use at
  runtime
* Update section on @CachePut

This commit also describes the support of standard JCache annotations,
i.e. JSR-107.

Issues: SPR-11490, SPR-11316, SPR-10629, SPR-9616, SPR-8696
2014-04-09 11:28:18 +02:00
Sam Brannen 0eba1f818f Use unconstrained quotes in reference manual
Prior to this commit, there were numerous places in the reference
manual, where we would see output similar to the following:

    BeanDefinition`s with the `ApplicationContext

This commit addresses this issue by using unconstrained quotes
(e.g., ++XYZ++s) instead of backticks (e.g., `XYZ`s) when the formatted
text is immediately followed by an "s".

This commit also corrects a few typos and corrects natural English
pluralization of Java code elements in the reference manual where
appropriate -- for example, "@Controllers" becomes "@Controller classes,
etc.

Issue: SPR-11650
2014-04-04 22:02:26 +02:00
Stephane Nicoll db23ec733b Add exception handling of asynchronous method
Prior to this commit, an exception thrown by an @Async void method
was not further processed as there is no way to transmit that
exception to the caller.

The AsyncUncaughtExceptionHandler is a new strategy interface that
can be implemented to handle unexpected exception thrown during the
invocation of such asynchronous method.

The handler can be specified using either the XML namespace or by
implementing the AsyncConfigurer interface with the EnableAsync
annotation.

Issue: SPR-8995
2014-04-02 15:04:40 +02:00
Sam Brannen 1f017c4acb Support classes AND locations in @ContextConfiguration
Prior to this commit, the Spring TestContext Framework did not support
the declaration of both 'locations' and 'classes' within
@ContextConfiguration at the same time.

This commit addresses this in the following manner:

 - ContextConfigurationAttributes no longer throws an
   IllegalArgumentException if both 'locations' and 'classes' are
   supplied to its constructor.

 - Concrete SmartContextLoader implementations now validate the
   supplied MergedContextConfiguration before attempting to load the
   ApplicationContext. See validateMergedContextConfiguration().

 - Introduced tests for hybrid context loaders like the one used in
   Spring Boot. See HybridContextLoaderTests.

 - Updated the Testing chapter of the reference manual so that it no
   longer states that locations and classes cannot be used
   simultaneously, mentioning Spring Boot as well.

 - The Javadoc for @ContextConfiguration has been updated accordingly.

 - Added hasLocations(), hasClasses(), and hasResources() convenience
   methods to MergedContextConfiguration.

Issue: SPR-11634
2014-04-01 19:45:56 +02:00
Stephane Nicoll dcf5f4a6a3 javax.annotation.Priority alternative to @Order
This commit rationalizes the use of @Order so that the standard
@Priority annotation can be used instead. The handling of both
annotations are now defined in OrderUtils.

This also updates the link to the JavaEE API so that we refer to
JavaEE7 instead of JavaEE6.

Issue: SPR-11639
2014-04-01 14:30:47 +02:00
Sam Brannen c924d659eb Update code templates in Eclipse settings
- Copyright is now through 2014.

 - Added "@since 4.1" tag to types.
2014-03-27 11:20:53 +01:00
Rossen Stoyanchev 32852e0843 Improve doc on authentication for stomp/websocket 2014-03-26 17:12:30 -04:00
Rossen Stoyanchev b02bda95b2 Document better ASYNC dispatch type config for Filters
Although the need to map the ASYNC dispatcher type to a Filter was
already mentioned, it wasn't very prominent and can be quite critical
in some cases. This change addresses that.

Issue: SPR-10440
2014-03-26 17:12:10 -04:00
Rossen Stoyanchev e6e12be5ef Fix typo in documentation 2014-03-26 11:32:34 -04:00
Rossen Stoyanchev 5dbcd76a71 Add doc section on configuration and performance
Issue: SPR-11450
2014-03-26 00:20:35 -04:00
Rossen Stoyanchev fd175180b9 Revise section explaining the flow of STOMP messages 2014-03-25 22:15:12 -04:00
Rossen Stoyanchev 84133c86fe Update SockJS overview section and polish 2014-03-25 22:15:12 -04:00
md42 b0e7f72a27 typo in pointcut expression 2014-03-25 17:15:07 +01:00
Sebastien Deleuze d67f0803c4 Update WebSocket engines support documentation 2014-03-25 11:05:47 -04:00
Rossen Stoyanchev c11484b2e7 Add WebSocket transport configuration support
Issue: SPR-11527
2014-03-24 19:20:38 -04:00
Sebastien Deleuze bbdb72d808 Add configuration for message buffer size limit
BufferingStompDecoder message buffer size limit can now be configured
with JavaConfig MessageBrokerRegistry.setMessageBufferSizeLimit() or
with XML <websocket:message-brocker message-buffer-size="">.

Issue: SPR-11527
2014-03-24 19:20:37 -04:00
Rossen Stoyanchev f25b7df552 Document heartbeat support in SockJS 2014-03-23 23:13:13 -04:00
Rossen Stoyanchev b1a0b38d8f Document use of CORS headers in SockJS Service
Issue: SPR-11437
2014-03-23 22:52:14 -04:00
Rossen Stoyanchev 15188a8eee Document IE 8 and 9 related SockJS transport details
Issue: SPR-11496, SPR-11525
2014-03-23 22:52:13 -04:00
Rossen Stoyanchev d30cb17c91 Polish SockJS documentation 2014-03-23 22:51:31 -04:00
Stephane Nicoll 4cd818b9e4 Harmonize log configuration
Prior to this commit, the codebase was using a mix of log4j.xml
and log4j.properties for test-related logging configuration. This
can be an issue as log4j takes the xml variant first when looking
for a default bootstrap configuration.

In practice, some modules declaring the properties variant were
taking the xml variant configuration from another module.

The general structure of the configuration has also been
harmonized to provide a standard console output as well as an
easy way to enable trace logs for the current module.
2014-03-20 09:43:29 -07:00
Sebastien Deleuze fb600857df Document locale convention in Tiles def file names
In Tiles v3 integration, underscores in filenames are
intended to identify the definition locale. This behavior
is now documented in order to avoid unexpected results
with filenames like tiles_definitions.xml.

This commit also updates Tiles v2 references to Tiles v3
in the Spring reference documentation.

Issue: SPR-11491
2014-03-17 21:37:37 -04:00
Sebastien Deleuze aac409c6cf Fix "Configuring the WebSocket Engine" documentation
This commit updates reference documentation in order
to specify that ServletServerContainerFactoryBean is for
server side use and WebSocketContainerFactoryBean
for client side use.

Issue: SPR-11565
2014-03-17 21:20:50 -04:00
Juergen Hoeller 264d7b9c98 Improved documentation on how to convert collections with ConversionService
Issue: SPR-11432
2014-03-10 18:18:29 +01:00
Sam Brannen 241682c117 Update author list in reference manual 2014-03-10 12:31:00 +01:00
Sam Brannen b364599278 Update links to Spring JIRA server 2014-03-10 12:26:29 +01:00
Sam Brannen 220267b830 Update copyright date in reference manual 2014-03-10 12:22:52 +01:00
Stephane Nicoll 542db72ffd Add first draft of IDEA code formatting
This commit provides a first attempt at defining a standard code
formatting scheme for the Spring Framework in Intellij IDEA.

These are the major changes compared to standard settings:

* default indent option to use tab character instead of space for
  all languages
* one space before the left brace of an array initializer
* keep when reformating: multiple expressions in one line,
  simple blocks in one line
* method declaration parameters: do not align when multiline
* else, catch and finally on new line
* keep one space before } (solely use to keep the space between the
  end of the last method and the end of the class)
* minimum blank line after class header 0 (instead of 1)
* Disabled Javadoc formatting
* class count to trigger static import to 50 (to prevent
  import org.foo.*; instead of listing the classes of org.foo)
* changed the import sequence to import in the following order:
  static imports, java.*, javax.*, others, org.springframework.*. Each
  sequence is separated by a space
2014-03-10 11:43:19 +01:00
Juergen Hoeller 2cdc066daf Relaxed statement on early validation of bean references
Issue: SPR-11495
2014-03-05 22:41:26 +01:00
Marcin Mielnicki 7cf5e3a508 Outdated code example correction in section 10.3.6 2014-03-03 22:20:28 +01:00
Brian Clozel 53017da0c3 Update reference documentation for SPR-11486
Issue: SPR-11486
2014-03-03 12:13:17 +01:00
Stephane Nicoll 035d9d5af0 Clarify exception handling in converter
Issue: SPR-11500
2014-03-03 10:02:39 +01:00
Rossen Stoyanchev 4238299661 Add smart logging for disconnected SockJS clients
The Servlet API does not provide notifications when a client
disconnects, see see https://java.net/jira/browse/SERVLET_SPEC-44.
Therefore network IO failures may occur simply because a client has
gone away. Before this change that could fill logs with unnecessary
stack traces.

After this change we make a best effort to identify such network
failures, on a per-server basis (tested with Jetty, Tomcat, Glassfish,
and WildFly), and log them under a separate log category.

A simple one-line message is logged at DEBUG level (i.e. no stack trace)
while a full stack trace is shown at TRACE level.

Issue: SPR-11438
2014-03-01 14:46:44 -05:00
Sam Brannen 5d4ed4efe5 Fix DocBook to AsciiDoc conversion errors
- "__ `text`__" --> "__`text`__"

 - "`text` s" --> "`text`s"
2014-02-28 22:31:06 +01:00
Oliver Gierke 74969a4794 Update ref. manual to favor constructor injection
The breakout box named "Constructor-based or setter-based DI?" in the
reference manual currently recommends the use of setter injection.

This commit refines this text to align with current best practices and
now favors constructor injection over setter injection.

Issue: SPR-11459
2014-02-28 21:53:54 +01:00
Juergen Hoeller 9af7d2646b Added documentation on how to set up JSR-303 method validation
Also removed outdated Struts references and made use of 'javadocs' term consistent.

Issue: SPR-11473
2014-02-28 19:02:18 +01:00
Rossen Stoyanchev 651e0a44fb Update documentation
Clarify ability to use @MessageMapping methods on both @Controller as
well as @RestController.

Add section on configuring connections (including credentials) to the
message broker and clarify the use of the login/passcode headerers of
the STOMP CONNECT frame.

Add note on when to add the reactor-tcp dependency.

Issue: SPR-11464, SPR-11436, SPR-11449
2014-02-25 11:31:13 -05:00
Rossen Stoyanchev 0cb27f4bc5 Allow HttpMethod as a controller method argument
Issue: SPR-11425
2014-02-13 12:16:24 -05:00
Rossen Stoyanchev 7301b58ec9 Improve info on use of @Controller's with aop proxying
Before this change, issues surrounding the use of @Controller's in
combination with AOP proxying, resulted in an IllegalArgumentException
when trying to invoke the controller method.

This change detects such cases proactively and reports them with a
clear recommendation to use class-based proxying when it comes to
@Controller's. This is the most optimcal approach for controllers
in many respects, also allows @MVC annotations to remain on the
class.

The documentation has also been updated to have a specific section
on @Controller's and AOP proxying providing the same advice.

Issue:SPR-11281
2014-02-11 12:25:54 -05:00
Rob Winch 14616a445a Update javadoc to conform to JDK8 styling
Issue: SPR-11412
2014-02-10 15:07:34 -06:00
Juergen Hoeller 9a8f860318 Fixed broken link to jax-ws-commons website
Issue: SPR-11404
2014-02-07 17:24:47 +01:00
Sam Brannen 7566ceb5f2 Fix minor typo in testing chapter 2014-02-06 21:47:42 +01:00
Sam Brannen 9a6252d715 Fix formatting in 'TCF support classes' section of ref
This commit fixes some formatting issues in the 'TestContext Framework
support classes' section of the reference manual that were introduced
in the conversion from DocBook to AsciiDoc.
2014-02-06 21:12:00 +01:00
Lukasz Kryger 14d3525a28 Minor corrections/typos to "27. Cache Abstraction" docs section 2014-01-28 12:30:04 +00:00
Stephane Nicoll 624f81a5a3 Improve 'switch off commons-logging' documentation
Update reference documentation to make it clearer that only
`spring-core` has a direct dependency on `commons-logging`.

Also reference the 'empty jar' alternative option as described in
the SLF4J FAQ.
2014-01-24 08:52:16 -08:00
Rossen Stoyanchev 09251dfad1 Fix typo 2014-01-22 16:49:00 -05:00
Rossen Stoyanchev 3ffc3d442d Document use of Jetty's WebSocketServerFactory
Issue: SPR-11023
2014-01-22 16:23:22 -05:00
Rossen Stoyanchev 74fe1aea31 Fix typo in documentation 2014-01-22 13:31:36 -05:00
Sam Brannen 499c858cd4 Suppress resource/deprecation warnings in integration tests 2014-01-22 17:45:45 +01:00
Stephane Nicoll 98174e101f Improve documentation of matrix variables.
Prior to this commit, it was not clear how to enable the support of matrix
variables in the mvc namespace. As the feature is disabled by default, added
something to highlight the part that explains how to configure it

Issue: SPR-11331
2014-01-22 10:28:07 -05:00
Rossen Stoyanchev 17e492e641 Polish
Issue: SPR-11129
2014-01-20 21:48:57 -05:00
Rossen Stoyanchev 809a5f59b3 Fix typo in reference
Issue: SPR-11311
2014-01-20 15:03:09 -05:00
Rossen Stoyanchev 19859fdb35 Add section on test STOMP/WebSocket applications
Issue: SPR-11266
2014-01-20 14:55:47 -05:00
Juergen Hoeller 05047d3a26 Declared JDK 6 update 18 as minimum requirement 2014-01-16 12:48:41 +01:00
Juergen Hoeller 50dfa037d0 Several ref doc fixes
Issue: SPR-8182
Issue: SPR-11243
Issue: SPR-11292
Issue: SPR-11318
2014-01-16 11:18:53 +01:00
Sam Brannen 5ee89a3021 Polish explanation of the 'default' profile
Issue: SPR-11256
2014-01-14 21:05:40 +01:00
Rossen Stoyanchev bac9f43b66 Fix typo in documentation
Issue: SPR-11301
2014-01-14 14:51:27 -05:00
Stephane Nicoll c9044151f5 Add explanation for the special 'default' profile
Better integrated explanation of the 'default' profile with both XML
and Java config examples showing the same thing.

Issue: SPR-11256
2014-01-14 14:32:50 -05:00
Vasyl Tretiakov 37c9b26ff8 Fix various documentation issues
- Remove formatting that interferes with code highlighting
- Fix some XML syntax issues
- Added missing punctuation
2014-01-09 22:37:25 -08:00
Stephane Nicoll 2afd9bc371 Removed reference to Cactus from documentation
Issue: SPR-11280
2014-01-09 16:17:21 -08:00
Lukasz Kryger f3a08447fd Removed extraneous character from the online documentation 2014-01-06 11:15:19 -08:00
Brian Clozel 2c8f670d5f Support Validation in @MessageMapping annotated methods
Payload parameters in @MessageMapping annotated
methods can now also be validated when annotated
with a Validation annotation (@Valid, @Validated...).

A default Validator is registered by the MessageBroker
Configurer, but it is possible to provide a list of custom
validators as well.

Issue: SPR-11185
2014-01-03 15:25:33 +01:00
Juergen Hoeller 6183683041 Fixed typos
Issue: SPR-11232
Issue: SPR-11242
2013-12-17 18:26:23 +01:00
Sam Brannen 1c04dcbe17 Update readme.txt with current links 2013-12-13 18:00:06 +01:00
Sam Brannen 0b6bd46863 Polish reference manual 2013-12-13 15:58:45 +01:00
Sam Brannen f199d5187b Polish reference manual 2013-12-13 15:35:38 +01:00
Phillip Webb 421292acf4 Final documentation polish before 4.0 2013-12-11 22:31:29 -08:00
Rossen Stoyanchev e637418010 Update stomp/websocket documentation 2013-12-11 23:36:55 -05:00
Rossen Stoyanchev f36863947d Update STOMP/WebSocket documentation 2013-12-11 21:18:06 -05:00
Juergen Hoeller 50b8a53415 What's New overhaul 2013-12-12 03:09:40 +01:00
Sam Brannen 6ee725031c Document meta-annotation support in the TCF
This commit documents meta-annotation support for test-related
annotations in the TestContext framework within the reference manual.

Issue: SPR-11109
2013-12-12 02:39:44 +01:00
Sam Brannen 341854fb56 Revised wording around “new in 3.2” 2013-12-12 01:53:29 +01:00
Sam Brannen 48ecf0af57 Do not format TestContext unless referring to class 2013-12-12 01:39:05 +01:00
Brian Clozel a9a20e297b changed Sun references and links to Oracle 2013-12-12 01:32:52 +01:00
Sam Brannen a83fb13fc4 Add Testing Improvements section to reference manual 2013-12-12 01:29:53 +01:00
Phillip Webb b085ec90b2 Replace references to VMware with Pivotal
Replace references to VMware in license, notices and maven generation
with Pivotal, Inc.

Issue: SPR-11073
2013-12-11 14:08:55 -08:00
Phillip Webb b124066d63 Add What's new in 4.0 to reference documentation
Update the reference documentation with "What's new in Spring 4.0".
2013-12-11 13:52:49 -08:00
Brian Clozel 309fe9ceb1 Document MVC concepts introduced in Spring 4.0
Update the MVC reference documentation with the new concepts and classes
introduced in Spring 4.0
This reverts commit 6f874d734a2a38431c74444894f54797ecf74933.
2013-12-11 13:52:49 -08:00
Rossen Stoyanchev 01a78bbbac Add WebSocket reference documentation
Update reference documentation with a new section for Spring 4's
WebSocket support.
2013-12-11 13:52:48 -08:00
Brian Clozel 0a52c86559 Clean MVC reference documentation
Remove reference to removed deprecations and generally cleanup the MVC
documentation.
Cleanup Struts
2013-12-11 13:52:48 -08:00
Phillip Webb d6b4d92eed Clean reference docs and prepare for Spring 4
Polish and cleanup the asciidoc source and prepare the reference guide
for the upcoming Spring 4.0 release.
2013-12-11 13:52:48 -08:00
Brian Clozel 8b48ba2af3 Remove the What's new in Spring 3 from docs
Remove the entire What's new in Spring 3 section from the reference
documentation.
2013-12-11 13:52:47 -08:00
Phillip Webb 7e1e99d272 Extract appendix from main index.adoc
Extract the appendix into a separate asciidoc file in order to make the
main index.adoc easier to work with.
2013-12-11 13:52:47 -08:00
Brian Clozel efc5074395 Document ControllerAdvice annotation
Issue: SPR-11149
2013-12-04 17:14:55 +01:00
Phillip Webb 59002f2456 Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.

Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.

Issue: SPR-11064
2013-11-25 12:52:42 -08:00
Phillip Webb f3504b2fd5 Fix docs sample for ConversionServiceFactoryBean
Fix the reference documentation example for ConversionServiceFactoryBean
to use a `<set>` instead of a `<list>`.

Issue: SPR-10802
2013-11-21 15:53:22 -08:00
Phillip Webb 5c7eaaa969 Fix SpEL docs indicating +/- is Supported on Date
Issue: SPR-11057
2013-11-20 13:13:27 -08:00
Phillip Webb 6f2004f4f8 Restore multi-page and PDF reference documentation
Generate docbook xml from the asciidoc reference guide and use the
docbook-reference-plugin to generate HTML (single and multi-page) and
PDF documentation.

Issue: SPR-11096
2013-11-19 16:50:56 -08:00
Phillip Webb e54fc7bbdc Add whitespace to improve asciidoc readability
Issue: SPR-11096
2013-11-19 16:50:46 -08:00
Phillip Webb 5d8b008a8b Remove superfluous spaces in asciidoc
Remove the superfluous spaces that appear in the asciidoc source.

Issue: SPR-11096
2013-11-19 16:39:37 -08:00
Phillip Webb a7251041f1 Fix broken reference guide links
Remove or replace broken links from the reference documentation.

Issue: SPR-11096
2013-11-18 20:20:23 -08:00
Phillip Webb 99cf06bfc9 Remove superfluous space before 'http' in asciidoc
Remove the superfluous space that appears before each 'http' reference
in the asciidoc source. Presumably there due to some quirk of the
docbook conversion.

Issue: SPR-11096
2013-11-18 20:17:54 -08:00
Phillip Webb 13bef4fd2d Specify asciidoc type
Specify a specific asciidoc type of 'docbook' to prevent
'multiple titles at level 0' errors during generation.

Issue: SPR-11096
2013-11-18 20:14:24 -08:00
Phillip Webb 8e60bbc3ee Replace asciidoc authors convention with attribute
Replace the second line of the asciidoc reference guide that, by
convention, specifies authors with an 'author' explicit attribute.

Issue: SPR-11096
2013-11-18 20:11:49 -08:00
Phillip Webb 7d7f0063f8 Wrap reference asciidoc at 90 characters
Reformat the asciidoc source for the reference guide to wrap at about
90 characters.

Issue: SPR-11096
2013-11-18 20:08:41 -08:00
Phillip Webb cb858a3b01 Replace springsource.org links with spring.io
Update reference documentation links to use the new spring.io domain.

Issue: SPR-11096
2013-11-18 10:12:19 -08:00
Phillip Webb 4b0de69246 Replace non UTF-8 characters in asciidoc source
Replace the odd instance of non UTF-8 characters in the reference
asciidoc source, mainly smart-quotes.

Issue: SPR-11096
2013-11-18 10:11:49 -08:00
Biju Kunjummen dfa7483812 Fix broken javadoc links in reference guide
Replace links in the reference documentation from
`http://static.springsource.org/spring/docs/current/api/..` to
`http://docs.spring.io/spring/docs/current/javadoc-api/..`

Issue: SPR-11087
2013-11-18 09:33:48 -08:00
Sam Brannen c09f85172b Use AsciiDoctor special characters
- Replaced ellipsis with "..."

 - Replaced em dash with "--"

 - Fixed issue with italics migration in the Standard Annotation Support
  section of the Testing chapter
2013-11-07 13:18:31 +01:00
Rob Winch dcc6ef262d Poish asciidoctor
Issues: SPR-10960
2013-11-05 16:50:06 -06:00
Rob Winch 7bf4324f0f Poish asciidoctor
Issues: SPR-10960
2013-11-05 13:52:25 -06:00
Rob Winch 3476d11fb8 Poish asciidoctor
Issues: SPR-10960
grate documentation to #	deleted:    src/reference/docbook/index.xml
2013-11-05 11:01:30 -06:00
Rossen Stoyanchev 2e57cf8bfc Fold spring-test-mvc sources into spring-test
With spring-test compiling against Servlet 3.0 it is no longer required
to compile Spring MVC Test sources separately (from spring-test).
2013-11-05 11:44:13 -05:00
Rob Winch fd0b6caf9e Migrate documentation to asciidoctor
This commit migrates to asciidoctor to ease writing documentation.

Issues: SPR-10960
2013-11-04 11:49:52 -06:00
Sam Brannen 7ffd05a8e3 Document 'annotated classes' in Testing chapter
In order to help developers avoid surprises from unintended use of
"@Bean Lite Mode" when referencing classes via @ContextConfiguration in
the TestContext framework, this commit duplicates the previous
discussion of "annotated classes" from the Javadoc for
@ContextConfiguration as a tip in the "Context configuration with
annotated classes" section of the Testing chapter in the reference
manual.

Issue: SPR-10971
2013-10-16 18:10:47 +02:00
Gary Russell 0e7769b5bb Add Reference to Spring AMQP Remoting in docs
Beginning with 1.2.0, Spring AMQP now supports remoting over AMQP with
a proxy factory bean an invoker service exporter.

Add documentation to the Spring Framework remoting section with a link
to the Spring AMQP documentation.

Issue: SPR-10501
2013-10-11 09:33:09 -07:00
Grzegorz Rożniecki 03daf593b2 Fix Cache documentation
Fixed malformed code snippets, formatted whitespace and changed invalid
external link.
2013-10-11 09:27:49 -07:00
Brian Clozel 62d6a43c61 Add NoHandlerFoundException to DispatcherServlet
Prior to this commit, the DispatcherServlet would send an error
response using the HttpServlet API when no Handler was found to
handle this request.

Now the DispatcherServlet can be configured to throw a
NoHandlerFoundException, when the throwExceptionIfNoHandlerFound
property is set to "true".
Those exceptions can be later on caught by default or custom
HandlerExceptionResolvers/ExceptionHandlers.

Issue: SPR-10481
2013-09-25 14:11:01 -04:00
Phillip Webb 371d255581 Fix typo in MVC reference documentation
Fix ContentNeogitatingViewResolver typo in MVC reference documentation.

Issue: SPR-10927
2013-09-23 16:05:00 -07:00
Grzegorz Rożniecki 00c744ba1a Fix malformed code in documentation
Fixed code snippets in "Handling complex types for stored procedure
calls" paragraph.

Issue: SPR-10798
2013-08-28 14:25:57 -07:00
clemp6r 84242f1aff Fix elvis operator mistake in reference docs
In the given example the expression using the Elvis operator will
return "Nikola Tesla" and not "Mike Tesla".

Issue: SPR-10850
2013-08-28 14:16:01 -07:00
Arjen Poutsma 3d645cf808 Added documentation on DecompressingHttpClient
Added documentation on the support for gzip encoding using the
DecompressingHttpClient in Apache HttpComponents.

Issue: SPR-7874
2013-08-28 14:09:07 +02:00
Juergen Hoeller bb18f81b50 Added "recovery-interval" attribute to <jms:listener-container>
Issue: SPR-10711
2013-08-28 09:36:23 +02:00
Juergen Hoeller 5d3d3c111b Revised JSR-303 references to include JSR-349 (Bean Validation 1.1) as well
Issue: SPR-10813
2013-08-20 22:38:17 +02:00
Lonre Wang 5549bd909e Fix typo in reference docs 2013-08-12 14:24:58 -07:00
Arjen Poutsma d9bfac393b Added reference to CatchAllConverter
Added reference to CatchAllConverter in both javadoc and reference docs.

Issue: SPR-10821
2013-08-12 12:26:34 +02:00
Rossen Stoyanchev 3482c170e0 Fix documentation typo 2013-07-30 15:40:49 -04:00
Arjen Poutsma 4da7e304b8 Additional docs about security vulnerabilities with XStream. 2013-07-24 10:24:13 -04:00
Phillip Webb 1204d2aef4 Fix case of rollbackForClassName in ref docs
Update @Transactional reference documentation to fix the case of the
rollbackForClassName and noRollbackForClassName attributes.

Issue: SPR-10754
2013-07-22 15:46:31 -07:00
Phillip Webb 5ee6bb9b9b Fix SQL syntax error in jdbcTemplate update docs
Update the reference guide jdbcTemplate update example to include the
column name.

Issue: SPR-10625
2013-06-25 22:20:41 -07:00
Phillip Webb c720d82596 Use 'Integer' not 'int' in queryForObject docs
Update queryForObject calls in the JDBC reference documentation to
use 'Integer.class' rather than the unsupported 'int.class'.

Issue: SPR-10651
2013-06-20 23:51:52 -07:00
Phillip Webb 26fb880622 Add mvc: prefix to mapping samples in ref docs
Add 'mvc:' namespace prefix to 'mapping' and 'exclude-mapping' elements
in the reference documentation.

Issue: SPR-10670
2013-06-20 16:17:00 -07:00
Sam Brannen 044f51283b Introduce ActiveProfilesResolver in the TCF
Prior to this commit, the active bean definition profiles to use when
loading an ApplicationContext for tests could only be configured
declaratively (i.e., via hard-coded values supplied to the 'value' or
'profiles' attribute of @ActiveProfiles).

This commit makes it possible to programmatically configure active bean
definition profiles in tests via a new ActiveProfileResolver interface.
Custom resolvers can be registered via a new 'resolver' attribute
introduced in @ActiveProfiles.

Overview of changes:

 - Introduced a new ActiveProfilesResolver API.
 - Added a 'resolver' attribute to @ActiveProfiles.
 - Updated ContextLoaderUtils.resolveActiveProfiles() to support
   ActiveProfilesResolvers.
 - Documented these new features in the reference manual.
 - Added new content to the reference manual regarding the
   'inheritProfiles' attribute of @ActiveProfiles
 - Removed the use of <lineannotation> Docbook markup in the testing
   chapter of the reference manual for Java code examples in order to
   allow comments to have proper syntax highlighting in the generated
   HTML and PDF.

Issue: SPR-10338
2013-06-16 00:01:34 +02:00
Phillip Webb e63ee1ee5a Fixed typo in docbook id
Issue: SPR-10394
2013-05-28 14:25:57 -07:00
Rossen Stoyanchev d23de282a6 Reinstate removal of semicolon content
Commit 5b1165 was an attempt to leave semicolon content in the URL path
while ignoring it for request mapping purposes. However, it becomes
quite difficult to manage and semicolon content should not always be
ignored (sometimes a semicolon is used as a separator of multiple items
in a path segment, rather than for matrix variables).

This change effectively reverts back to the original approach in 3.2
where a flag on AbstractHandlerMapping can be used to have semicolon
content removed or kept. If kept, path segments with matrix variables
must be represented with a path segment.

The main difference is that by default it is removed everywhere
including the MVC namespace and Java config.

Issue: SPR-10427, SPR-10234
2013-05-14 21:32:09 -04:00
Juergen Hoeller 35847ad003 Fixed MockMvc example code
Issue: SPR-10389
2013-05-07 21:38:45 +02:00
Juergen Hoeller 0fc5a5d912 Introduced 4.0 versions of all XML configuration schemas
Removed spring-beans.dtd (the 1.x variant) and spring-oxm-1.5.xsd (pre-Spring-Framework variant), in order to raise the backwards compatibility limit a little bit at least. We'll keep supporting the 2.0 and 2.5 xsd versions for the time being, as well as spring-beans-2.0.dtd.

Removed the ref 'local' attribute in spring-beans-4.0.xsd since 'local' lost its differentiating role to a regular bean ref back in the 3.1 days when we started allowing for the same bean id to reappear in a different beans section of the same configuration file (with a different profile).

Issue: SPR-10437
2013-05-07 18:11:51 +02:00
Juergen Hoeller 47103ed1b3 Link to JIRA change log instead of local changelog.txt file 2013-05-02 11:37:26 +02:00
Juergen Hoeller f374b7ae2b Fixed typo in code example
Issue: SPR-10394
2013-04-30 22:10:26 +02:00
Juergen Hoeller 6be954e4cd Removed references to deprecated queryForInt method from documentation
Issue: SPR-10257
2013-04-30 22:09:50 +02:00
Sam Brannen bee3263322 Initial changelog entries for 4.0 M1 2013-04-28 19:24:52 +02:00
Sam Brannen 2685818e91 Delete deprecated code in the TestContext framework
This commit deletes the deprecated @ExpectedException and
@NotTransactional annotations, supporting code, and related Javadoc and
reference documentation.

Issue: SPR-10499
2013-04-28 17:31:54 +02:00
Juergen Hoeller d3a4068768 Minimized ASM usage
In particular, avoid accidental usage of ASM for core JDK types - which will fail in case of a new bytecode version in the JDK, even if the application itself has been compiled with an earlier bytecode target.

Issue: SPR-10292
2013-04-23 13:49:25 +02:00
Phillip Webb 761bd9fd56 Merge branch '3.2.x'
* 3.2.x:
  Update javadoc external links
  JdbcTemplate etc
  Removed unnecessary default value of LifecycleGroup.lifecycleBeans
  Introduced public ArgumentPreparedStatementSetter and ArgumentTypePreparedStatementSetter classes
  Defensively uses JDBC 3.0 getParameterType call for Oracle driver compatibility
  Preparations for 3.2.3
  Fixed ReflectiveMethodResolver to avoid potential UnsupportedOperationException on sort
  Fixed Jaxb2Marshaller's partial unmarshalling feature to consistently apply to all sources
  Update copyright year in reference documentation

Conflicts:
	build.gradle
	gradle.properties
	spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java
	spring-jdbc/src/main/java/org/springframework/jdbc/core/ArgumentPreparedStatementSetter.java
	spring-jdbc/src/main/java/org/springframework/jdbc/core/ArgumentTypePreparedStatementSetter.java
2013-04-13 09:39:09 -07:00
Juergen Hoeller 7ef5c5cc84 Added missing section end tag 2013-03-19 16:45:31 +01:00
Juergen Hoeller 55901e677f Removed EJB 2.x implementation class hierarchy (ejb.support package) 2013-03-19 15:07:51 +01:00
Juergen Hoeller 30a9dad5fe Removed iBATIS SQL Maps support 2013-03-19 15:03:38 +01:00
Juergen Hoeller f1258a6a02 Removed JAX-RPC support 2013-03-19 15:00:17 +01:00
Juergen Hoeller 9c52ae9558 Removed OC4J support (including documentation references) 2013-03-19 14:53:26 +01:00
Juergen Hoeller a18935dfa1 JdbcTemplate etc 2013-03-19 11:31:09 +01:00
Juergen Hoeller ff6d7a858e Preparations for 3.2.3 2013-03-19 10:58:36 +01:00
Phillip Webb dc9fee0b5c Update copyright year in reference documentation 2013-03-14 11:53:09 -07:00
Phillip Webb 5730b8d316 Document @Bean 'lite' mode vs @Configuration
Rework the reference documentation to better distinguish the differences
between @Bean methods used in @Comonent vs @Configuration classes. The
'Using the @Bean annotation' section now only covers concepts applicable
when using @Bean methods in @Configuration _or_ @Component classes.
Information only applicable to @Configuration classes has been moved to
a new  'Using the @Configuration annotation' section.

An additional sidebar section attempts to explain the differences
between the two approaches.

Issue: SPR-9425
2013-03-13 09:44:35 -07:00
Juergen Hoeller 457ee07352 Final preparations for 3.2.2 2013-03-13 17:37:30 +01:00
Sam Brannen 4171646491 Document context hierarchy support in the TCF
This commit updates the reference manual regarding the new support for
@ContextHierarchy and hierarchy modes in @DirtiesContext.

Issue: SPR-10357
2013-03-11 02:26:33 +01:00
Sam Brannen 2b24e99d44 Reformat the testing chapter
This commit reformats the testing chapter (and adds minor polishing
changes) in order to avoid massive merge diffs in upcoming commits.

Issue: SPR-10357
2013-03-10 14:49:10 +01:00
Sam Brannen 98074e7762 Provide support for context hierarchies in the TCF
Prior to this commit the Spring TestContext Framework supported creating
only flat, non-hierarchical contexts. There was no easy way to create
contexts with parent-child relationships.

This commit addresses this issue by introducing a new @ContextHierarchy
annotation that can be used in conjunction with @ContextConfiguration
for declaring hierarchies of application contexts, either within a
single test class or within a test class hierarchy. In addition,
@DirtiesContext now supports a new 'hierarchyMode' attribute for
controlling context cache clearing for context hierarchies.

- Introduced a new @ContextHierarchy annotation.
- Introduced 'name' attribute in @ContextConfiguration.
- Introduced 'name' property in ContextConfigurationAttributes.
- TestContext is now aware of @ContextHierarchy in addition to
  @ContextConfiguration.
- Introduced findAnnotationDeclaringClassForTypes() in AnnotationUtils.
- Introduced resolveContextHierarchyAttributes() in ContextLoaderUtils.
- Introduced buildContextHierarchyMap() in ContextLoaderUtils.
- @ContextConfiguration and @ContextHierarchy may not be used as
  top-level, class-level annotations simultaneously.
- Introduced reference to the parent configuration in
  MergedContextConfiguration and WebMergedContextConfiguration.
- Introduced overloaded buildMergedContextConfiguration() methods in
  ContextLoaderUtils in order to handle context hierarchies separately
  from conventional, non-hierarchical contexts.
- Introduced hashCode() and equals() in ContextConfigurationAttributes.
- ContextLoaderUtils ensures uniqueness of @ContextConfiguration
  elements within a single @ContextHierarchy declaration.
- Introduced CacheAwareContextLoaderDelegate that can be used for
  loading contexts with transparent support for interacting with the
  context cache -- for example, for retrieving the parent application
  context in a context hierarchy.
- TestContext now delegates to CacheAwareContextLoaderDelegate for
  loading contexts.
- Introduced getParentApplicationContext() in MergedContextConfiguration
- The loadContext(MergedContextConfiguration) methods in
  AbstractGenericContextLoader and AbstractGenericWebContextLoader now
  set the parent context as appropriate.
- Introduced 'hierarchyMode' attribute in @DirtiesContext with a
  corresponding HierarchyMode enum that defines EXHAUSTIVE and
  CURRENT_LEVEL cache removal modes.
- ContextCache now internally tracks the relationships between contexts
  that make up a context hierarchy. Furthermore, when a context is
  removed, if it is part of a context hierarchy all corresponding
  contexts will be removed from the cache according to the supplied
  HierarchyMode.
- AbstractGenericWebContextLoader will set a loaded context as the
  ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE in the MockServletContext when
  context hierarchies are used if the context has no parent or if the
  context has a parent that is not a WAC.
- Where appropriate, updated Javadoc to refer to the
  ServletTestExecutionListener, which was introduced in 3.2.0.
- Updated Javadoc to avoid and/or suppress warnings in spring-test.
- Suppressed remaining warnings in code in spring-test.

Issue: SPR-5613, SPR-9863
2013-03-07 02:11:11 +01:00
Phillip Webb 05765d7520 Replace EasyMock with Mockito
Issue: SPR-10126
2013-03-06 11:06:15 -08:00
Juergen Hoeller 4cc30fe541 DefaultLobHandler etc 2013-03-01 21:55:01 +01:00
Jakub Narloch 5d727b2d8e Add Castor XSD information to reference docs
Update the Spring OXM reference documentation to include changes
introduced in CastorMarshaller, specifically around CastorMarshaller
XSD configuration.

Issue: SPR-8509
2013-03-01 11:40:32 -08:00
Tomasz Nurkiewicz c4ba8ce124 Fix incorrect closing <web-app> tag in MVC docs 2013-02-28 15:49:44 -08:00
Phillip Webb 0f2e94f0fc Fix reference docs section on inner beans
Inner beans are not prototype beans as, in contrast to what is
documented in the section for prototype beans, the inner bean does
get destruction callbacks applied.

Issue: SPR-10311
2013-02-27 13:44:33 -08:00
Chris Beams 3a192a0701 Update Eclipse import organization rules
The following changes have been made to the JDT UI prefs to conform to
existing conventions throughout the codebase:

 - always favor .* syntax for static imports
 - always list static imports last

Re-run `gradle eclipse` and refresh projects within Eclipse to make
this change take effect.
2013-02-26 14:21:01 +01:00
Phillip Webb da034eb020 Replace references to SimpleJdbcTemplate in docs
Rework JDBC section of the manual to remove references to the now
deprecated SimpleJdbcTemplate class.

Issue: SPR-10317
2013-02-25 16:33:15 -08:00
Phillip Webb 7e2022b9a7 Fix @RequestMapping regex reference doc example
Issue: SPR-10244
2013-02-19 11:48:55 -08:00
Juergen Hoeller 7d20c7a62f Module POMs, etc 2013-02-15 18:31:49 +01:00
Juergen Hoeller f0787bdb86 Fixed @Configurable documentation with respect to logging when the aspect hasn't been configured
Issue: SPR-10295
2013-02-15 13:32:46 +01:00
Juergen Hoeller 81a929aed3 Removed outdated EJB reference from auto-proxying documentation.
Issue: SPR-10299
2013-02-15 13:32:45 +01:00
Juergen Hoeller 8987ceea93 Fixed @Configurable documentation with respect to the use of a prototype-scoped bean definition.
Issue: SPR-10298
2013-02-15 13:32:45 +01:00
Arjan van Bentem 24ed325c0c Add HttpPutFormContentFilter note to documentation
Update reference guide to include a note about the use of
HttpPutFormContentFilter in combination with @RequestBody
MultiValueMap and HttpEntity.

Issue: SPR-8415
2013-02-13 11:50:34 -08:00
Phillip Webb 39c6341cea Fix type in "what's new in 3.2" section
Issue: SPR-10283
2013-02-12 22:43:40 -08:00
Phillip Webb 9320bf1316 Fix @RequestMapping regex reference doc example
Issue: SPR-10244
2013-02-11 20:56:59 -08:00
Juergen Hoeller 08e1cbc02b Jaxb2Marshaller etc 2013-02-11 21:52:05 +01:00
Juergen Hoeller d442c40e0c Added section on GemFire as a cache provider choice (SPR-9468) 2013-02-10 23:53:19 +01:00
Juergen Hoeller c4194ee175 Added paragraph on BeanPostProcessor side effects when autowiring dependencies into it (SPR-9577) 2013-02-10 23:53:18 +01:00
Juergen Hoeller 00a3420c6f CastorMarshaller etc 2013-02-10 21:11:13 +01:00
Juergen Hoeller 01c44c8bf6 Further enhancements for 3.2.2 2013-02-10 00:02:45 +01:00
Juergen Hoeller 9881517f61 Further enhancements for 3.2.2 2013-02-08 22:26:03 +01:00
Phillip Webb 584e79c677 Promote use of @PostConstruct and @PreDestroy
Update reference documentation to promote the use of the JSR-250
@PostConstruct and @PreDestroy annotations.

Issue: SPR-8493
2013-02-07 17:25:16 -08:00
Juergen Hoeller f9bac48d84 Further preparations for 3.2.2 2013-02-08 00:59:45 +01:00
Juergen Hoeller 1ed26d6389 Preparations for 3.2.2 2013-02-06 21:48:28 +01:00
Phillip Webb 1c724069c3 Improve presentation of code blocks in Javadoc
Include custom javadoc css that formats <pre class="code"> blocks.

Issue: SPR-10155
2013-02-04 15:05:08 -08:00
Phillip Webb a6b70722fa Update Quartz documentation to use FactoryBeans
Update examples for Quartz scheduling to use SimpleTriggerFactoryBean
and CronTriggerFactoryBean instead of SimpleTriggerBean and
CronTriggerBean.

Issue: SPR-10209
2013-02-04 13:57:48 -08:00
Phillip Webb 8c2ace33cb Support 'unless' expression for cache veto
Allow @Cachable, @CachePut and equivalent XML configuration to provide
a SpEL expression that can be used to veto putting an item into the
cache. Unlike 'condition' the 'unless' parameter is evaluated after
the method has been called and can therefore reference the #result.

For example:

    @Cacheable(value="book",
        condition="#name.length < 32",
        unless="#result.hardback")

This commit also allows #result to be referenced from @CacheEvict
expressions as long as 'beforeInvocation' is false.

Issue: SPR-8871
2013-02-04 11:59:15 -08:00
Sam Brannen ae0c34baaf Improve 3.2 migration guide re: JUnit & Hamcrest
This commit improves the "Spring Test Dependencies" section of the 3.2
migration guide by correctly explaining that Hamcrest Core is now a
required transitive dependency of JUnit.

Issue: SPR-10251
2013-02-01 15:40:01 +01:00
Phillip Webb aac6b913d6 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Fix unnecessary @SupressWarnings annotations
  Fix Javadoc warnings
  Fix unused local variable warnings
  Fix unused type compiler warnings
  Fix 'is already an instance of type' warnings
2013-01-31 12:52:51 -08:00
Juergen Hoeller bd72fcd469 Initial preparations for 3.2.2 2013-01-31 16:53:58 +01:00
Ken Dombeck b8e7314c43 Fix typo in new-in-3.2.xml document
This commit fixes a typo in the "New Features and Enhancements in Spring
Framework 3.2" chapter of the reference manual. Specifically,
ContentNegotiationStrategy is now spelled correctly.
2013-01-26 15:12:12 +01:00
Phillip Webb 2b0d860923 Fix Javadoc warnings 2013-01-25 17:31:33 -08:00
Phillip Webb 065b1c0e46 Fix unused local variable warnings 2013-01-25 14:35:19 -08:00
Phillip Webb 1065d82f08 Remove eclipse project specific Javadoc settings
Remove Javadoc settings from generated eclipse meta-data. Unfortunately
eclipse provides too many false warnings due to the fact that @Link and
@See tags in Spring often refer modules to which they cannot directly
depend.
2013-01-25 10:58:24 -08:00
Phillip Webb a99a4ed9b5 Tweak gradle generated eclipse meta-data
- Change output folders to /bin/main and /bin/test. This prevents
   'gradle clean' from breaking eclipse.

 - Update copyright header for new files to '2002-2013'
2013-01-24 09:44:25 -08:00
Juergen Hoeller 8625504711 Completed changelog entries for 3.2.1 2013-01-24 16:45:06 +01:00
Juergen Hoeller 919aeb5df9 Final preparations for 3.2.1 2013-01-23 23:34:21 +01:00
Sam Brannen e4f1f682e2 Update distribution README regarding paths
- Corrected path to 'docs/spring-framework-reference'
- Minor formatting changes
2013-01-23 17:09:45 +01:00
Juergen Hoeller 5fb75304eb Final preparations for 3.2.1 2013-01-23 01:32:29 +01:00
Juergen Hoeller 0a09da7534 Final preparations for 3.2.1 2013-01-22 21:12:08 +01:00
Rossen Stoyanchev 692ced8046 Fix typo in reference docs
Issue: SPR-10204
2013-01-22 14:15:22 -05:00
Chris Beams d3f4528905 Remove additional xsd versions from reference docs
A few versioned xsd references still existed in xsd-configuration.xml;
this commit removes them, completing the work for SPR-10010

Issue: SPR-10010
2013-01-22 16:02:31 +01:00
Chris Beams d40c8cfc58 Fix broken Castor URLs in ref docs and mapping XML
Issue: SPR-10189
2013-01-21 11:21:44 +01:00
Chris Beams 24cc33306d Fix typo in reference documentation
Issue: SPR-10171
2013-01-21 11:07:04 +01:00
Juergen Hoeller 87968e5a71 Further preparations for 3.2.1 2013-01-18 18:01:33 +01:00
Juergen Hoeller 13cf1fceaa Fixed reference to "fallbackToNoOpCache" flag
Issue: SPR-9064
2013-01-18 13:49:57 +01:00
Juergen Hoeller cd2183f9e1 Fixed ConnectionSpecConnectionFactoryAdapter explanation
Issue: SPR-9466
2013-01-18 13:47:11 +01:00
Juergen Hoeller 8a12b9e23f Removed reference to AttributesJmxAttributeSource
Issue: SPR-8916
2013-01-18 13:42:21 +01:00
Juergen Hoeller e44b4b831e Further fixes for 3.2.1 2013-01-15 22:10:14 +01:00
Rossen Stoyanchev a16bad04f0 Update Validation chapter
The Validation chapter now includes information on combining JSR-303
Bean Validation with additional Spring Validator's that don't require
the use of annotations.

Issue: SPR-9437
2013-01-14 22:00:54 -05:00
Phillip Webb d40bd8bd19 Tweak eclipse warning settings
Hide raw-type, generic and resource leak warnings.
2013-01-14 11:43:58 -08:00
Phillip Webb 2db7a12288 Generate eclipse project settings from gradle
Update gradle to generate the following project specific eclipse
settings:

- Java formatting
- Cleanup options
- Warning settings
- Code template with copyright header
- WTP module meta-data

In addition this commit changes the eclipse project .classpath file
to output test and main classes to different folders. This is required
to prevent eclipse WTP from packaging test classes into /WEB-INF/lib
jar files.

Issue: SPR-9518
2013-01-11 12:43:16 -08:00
Juergen Hoeller ea823fd398 AnnotationAwareOrderComparator etc 2013-01-10 17:01:18 +01:00
Rossen Stoyanchev 24ffa5a706 Update info on RestTemplate related to 401 status code
Issue: SPR-9367
2013-01-08 10:48:22 -05:00
Rossen Stoyanchev 2ac4a8c541 Update mvc chapter on annotations and proxies
Issue: SPR-10132
2013-01-08 10:01:51 -05:00
Chris Beams b8f223c404 Add 3.1 migration section to reference docs
Address error raised when using component-scan against the unqualified
"org" base package.

Issue: SPR-9843
2013-01-08 11:30:22 +01:00
Rossen Stoyanchev 7bc9667913 Add support for placeholders in @RequestMapping
@RequestMapping annotations now support ${...} placeholders.

Issue: SPR-9935
2013-01-07 18:06:47 -05:00
Chris Beams 676231644d Update Apache license headers for moved files
Issue: SPR-9431
2013-01-04 12:20:13 +01:00
Chris Beams 42729014b6 Move namespace tests to root integration module
Prior to this change, spring-beans contained its own META-INF containing
spring.handlers and spring.schemas files in src/main/resources; it also
had files of the same name within src/test/resources/META-INF, causing
'duplicate resource' warnings and confusion in general.

This commit moves the com.foo test package, it's associated namespace
parsing tests and test versions of META-INF files to the root project
and it's src/test integration testing folder.

Issue: SPR-9431
2013-01-04 12:16:20 +01:00
Phillip Webb 42b5d6dd7e Remove duplicate test classes
Prior to this commit many test utility classes and sample beans were
duplicated across projects. This was previously necessary due to the
fact that dependent test sources were not shared during a gradle
build. Since the introduction of the 'test-source-set-dependencies'
gradle plugin this is no longer the case.

This commit attempts to remove as much duplicate code as possible,
co-locating test utilities and beans in the most suitable project.
For example, test beans are now located in the 'spring-beans'
project.

Some of the duplicated code had started to drift apart when
modifications made in one project where not ported to others. All
changes have now been consolidated and when necessary existing tests
have been refactored to account for the differences.

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
2013-01-04 10:02:29 +01:00
Phillip Webb 65fb26f847 Move spring-build-junit into spring-core
Move code from spring-build-junit into spring-core/src/test along with
several other test utility classes. This commit removes the temporary
spring-build-junit project introduced in commit
b083bbdec7.
2013-01-01 19:49:45 -08:00
Tom Mack 005ee7385f Remove extra URL prefix in the MVC chapter
A link in the MVC chapter of the reference manual contained an extra
"http://" URL prefix.

This commit removes the extra "http://" URL prefix.
2012-12-28 23:18:18 +01:00
Chris Beams 8472a2b2ab Update Apache license headers for affected sources 2012-12-28 23:09:31 +01:00
Phillip Webb 60032e0012 Ignore performance-sensitive tests by default
Make use of the new JUnit functionality introduced in the previous
commit to 'Assume' that perfomance- and timing-sensitive tests should
run only when TestGroup.PERFORMANCE is selected, i.e. when
-PtestGroups="performance" has been provided at the Gradle command line.

The net effect is that these tests are now ignored by default, which
will result in far fewer false-negative CI build failures due to
resource contention and other external factors that cause slowdowns.

We will set up a dedicated performance CI build to run these tests on
an isolated machine, etc.

Issue: SPR-9984
2012-12-28 23:08:37 +01:00
Chris Beams 4c8cd7b0bd Add @Override annotations to test sources
Issue: SPR-10129
2012-12-28 23:05:44 +01:00
Phillip Webb b0986049a3 Fix [serial] compiler warnings
Fix serialization warnings by applying @SuppressWarnings("serial")
when appropriate.

In certain cases and for unknown reasons, a correctly-placed
@SuppressWarnings("serial") annotation will fix the warning at the
javac level (i.e. the Gradle command-line), but will produce an
"unnecessary @SuppressWarnings" warning within Eclipse. In these
cases, a private static final serialVersionUID field has been added
with the default value of 1L.
2012-12-28 22:41:06 +01:00
Phillip Webb 1762157ad1 Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
    xargs perl -p -i -e "s/[ \t]*$//g" {} \;

Issue: SPR-10127
2012-12-28 20:49:45 +01:00
Juergen Hoeller a30ee0164a Initial preparations for 3.2.1 2012-12-20 17:35:31 +01:00
Sam Brannen 155aecf557 Fix typo in 3.2 migration guide
- @WebApplicationContext --> @WebAppConfiguration

Backport-Commit: 62e9d6b105
2012-12-17 18:40:54 +01:00
Chris Beams b472fe361d Restore 3.2.0.RELEASE url paths in migration guide 2012-12-13 17:35:15 +01:00
Chris Beams f1550b67fa Update "what's new" in 3.1 and 3.2 sections
- Remove unnecessary "overview of new features" section in 3.1
 - Mention new Gradle build and GitHub-based source control in 3.2
2012-12-13 15:43:02 +01:00
Juergen Hoeller 22e9e0bf03 Minor rewording 2012-12-13 12:20:25 +01:00
Juergen Hoeller 0019d68c75 Final preparations for 3.2 GA 2012-12-13 11:33:35 +01:00
Juergen Hoeller bda07059d0 What's new and migration doc updates 2012-12-13 01:38:13 +01:00
Sam Brannen 59a8da3eff Polish the migration guide
- Added missing <para> tags to the JDiff reports section.

 - Converted tabs to spaces.
2012-12-13 01:14:08 +01:00
Sam Brannen 2775862c50 Update migration guide regarding spring-test
This commit adds information to the 3.2 migration guide regarding
deprecations and Maven dependencies in the spring-test module.
2012-12-13 01:05:15 +01:00
Phillip Webb b3b1fe1566 Update API links in reference documentation
Replace all API links with the correct springsource.org URL
2012-12-12 15:49:00 -08:00
Juergen Hoeller 8aed322284 Final preparations for 3.2 GA 2012-12-13 00:39:55 +01:00
Chris Beams 3458d4d945 Add 'Migrating to Spring Framework 3.2' appendix 2012-12-12 22:45:30 +01:00
Chris Beams a4f882fbf0 Fully qualify Spring=>Spring Framework in ref docs
This is not a comprehensive update, only covering the "What's new"
sections for now.
2012-12-12 22:45:30 +01:00
Rossen Stoyanchev 26b1f44ce7 Update reference doc for async web request config
Issue: SPR-9400
2012-12-12 12:58:47 -05:00
Rossen Stoyanchev c209b6700a Update reference docs on content negotiation config 2012-12-12 12:33:47 -05:00
Chris Beams 4badf2503b Upgrade to AspectJ 1.7.1
This change upgrades the spring-framework build to AspectJ 1.7.1 to
ensure compatibility. We remain backward-compatible to at least AJ
1.6.12 (the previous version), and likely back to 1.6.7.

AJ 1.7 allows for weaving Java 7 bytecode, particularly with regard
to invokedynamic instructions, and furthermore makes improvements to
the aspectj language itself to allow users to take advantage of Java 7-
style language features within aspects. See [1] for details.

[1]: http://eclipse.org/aspectj/doc/released/README-170.html

Issue: SPR-10079
2012-12-12 13:33:21 +01:00
Phillip Webb 6a6b441ffd Document annotation-config / component-scan tip
Document that the <context:annotation-config> element is usually
not required when using <context:component-scan>.

Issue: SPR-9808
2012-12-11 21:38:54 -08:00
Phillip Webb a263fd343d Use consistent XML docbook namespace format
Reorder XML namespace imports for consistency with other docbook
files.
2012-12-11 21:10:05 -08:00
Rossen Stoyanchev e09bdb31cc Add reference documentation for async web requests
Issue: SPR-9400
2012-12-11 23:12:00 -05:00
Juergen Hoeller 5b2cd763cf Final preparations for 3.2 GA 2012-12-12 03:31:39 +01:00
Sam Brannen d4c55838ad Document testing in "New in Spring 3.2" sect.
This commit adds documentation to the "New Features and Enhancements in
Spring 3.2" section of the reference manual regarding new testing
features.

Issue: SPR-9941
2012-12-12 01:38:23 +01:00
Sam Brannen a1053d4364 Document WebApplicationContext support in the TCF
This commit adds documentation for the following new features in the
Spring TestContext Framework within the Testing chapter of the reference
manual.

 - @WebAppConfiguration and context caching
 - WebDelegatingSmartContextLoader
 - AnnotationConfigWebContextLoader
 - GenericXmlWebContextLoader
 - Loading a WebApplicationContext in integration tests
 - ServletTestExecutionListener
 - Testing request and session scoped beans

Issue: SPR-9864
2012-12-12 00:56:26 +01:00
Sam Brannen 7f1b990ee9 Reformat the Testing chapter
Reformatted the Testing chapter in preparation for upcoming changes.
2012-12-11 22:47:44 +01:00
Rossen Stoyanchev acf32726d7 Add documentation for Spring MVC Test
Issue: SPR-9860, SPR-9886
2012-12-11 16:11:47 -05:00
Sam Brannen 4be2d15950 Reformat the Testing chapter
Reformatted the Testing chapter in preparation for upcoming changes.
2012-12-11 22:03:18 +01:00
Rossen Stoyanchev 85a552daed Fix package cycle among http message converters
This change introduces a new AllEncompassingFormHttpMessageConverter
class that adds JSON and XML converters for individual mime parts of
a multi-part request. The new converter is used in place of the
previously used XmlAwareFormHttpMessageConverter.

Issue: SPR-10055
2012-12-07 18:12:11 -05:00
Juergen Hoeller d6b9c6a475 Removed coverage of deprecated java.util.Timer support
Issue: SPR-10050
2012-12-05 19:19:24 +01:00
Sam Brannen 8a422f48c6 Update changelog re: comments in SQL statements
Issue: SPR-9982, SPR-10075
2012-12-05 17:49:47 +01:00
Sam Brannen 2b4ecfad12 Upgrade to JUnit 4.11
This commit upgrades the compile dependency on JUnit in the spring-test
module as well as the global test dependency on JUnit for the entire
test suite to 4.11 GA.

In addition, the spring-test module now depends on junit:junit instead
of junit:junit-dep since, as of JUnit 4.11, the "junit" Maven artifact
no longer inlines hamcrest-core.

Issue: SPR-10044
2012-12-05 11:29:50 +01:00
Phillip Webb 1352222ea6 Upgrade reference plugin and remove custom xsl
Upgrade to docbook-reference-plugin v0.2.2 and remove custom xsl
styles in favor of plugin defaults. Modify some docbook source
files to work with newer style.
2012-12-04 14:08:21 -08:00
Rossen Stoyanchev 7ff964afa8 Add JSON converters to FormHttpMessageConverter
The FormHttpMessageConverter now adds Jackson JSON converters
(version 1.x or 2.x) if available on the classpath.

Issue: SPR-10055
2012-12-03 15:11:13 -05:00
Juergen Hoeller 1b6f3d0352 Preparations for 3.2 GA 2012-11-29 23:28:57 +01:00
Chris Beams 7cc492de4f Update changelog 2012-11-27 10:02:51 +01:00
Juergen Hoeller cf681a809e Final preparations for 3.2 RC2 2012-11-26 22:47:09 +01:00
Phillip Webb 1e48c789da Update whats new in Spring 3.2
Issue: SPR-10015
2012-11-25 23:04:00 -08:00
Phillip Webb 37b0277a89 Restore custom reference manual titlepage
Restore the custom title page of the reference manual in order to
remove the large list of authors on the first page.

Note: This change will require updating to version 0.1.7 of the
docbook-reference-plugin when it is released.

Issue: SPR-10008
2012-11-25 20:22:26 -08:00
Phillip Webb 5a2130ad1a Polish maven samples to xml language
Set the language attribute on the maven <programlisting> elements
in the reference documentation to xml.
2012-11-25 20:13:41 -08:00
Phillip Webb 2b6d724fae Remove xsd versions from reference samples
Remove all xsd versions from the reference manual samples in favor of
"versionless" XSDs. For example, spring-beans-3.0.xsd becomes
spring-beans.xsd

Issue: SPR-10010
2012-11-25 20:00:25 -08:00
Phillip Webb 3749313d2f Drop Appendix E. spring-beans-2.0.dtd from docs
Issue: SPR-10011
2012-11-25 19:31:01 -08:00
Phillip Webb 438c2d8fc2 Update Spring logo in the PDF reference guide 2012-11-25 19:21:27 -08:00
Phillip Webb e0b1c0e614 Remove duplicate imagedata from reference guide
Prior to this commit many imagedata elements were duplicated in
order to configure PDF sizes. Since HTML generation is configured
to ignore image scaling altogether this was unnecessary duplication.

Issue: SPR-10033
2012-11-25 19:16:16 -08:00
Phillip Webb c37080d49d Migrate reference guide to well-formed docbook XML
Convert all docbook XML files to well-formed docbook 5 syntax:
 - Include xsi:schemaLocation element for tools support
 - Convert all id elements to xml:id
 - Convert all ulink elements to link
 - Simplify <lineannotation> mark-up
 - Fix misplaced </section> tags
 - Fix <interface> tags to <interfacename>
 - Cleanup trailing whitespace and tabs

Issue: SPR-10032
2012-11-25 19:02:55 -08:00
Juergen Hoeller 89b443c198 Allow for more async running time in succeedsWhenSubclassProxyAndScheduledMethodNotPresentOnInterface
After all, this test fails quite often as part of the CI build...
2012-11-26 00:54:07 +01:00
Juergen Hoeller 5af1c84b6d Preparations for 3.2 RC2 2012-11-25 23:41:32 +01:00
Sam Brannen 202b15e19b Fix typo and polish formatting 2012-11-25 15:57:15 +01:00
Phillip Webb c5f391550c Document global date time format configuration
Update reference documentation to detail how global date and time
formats can be specified.

Issue: SPR-9952
2012-11-21 20:42:41 -08:00
Phillip Webb fddb829b8b Update Joda Time references in documentation
Update documentation to reflect the fact that Joda Time is no longer
required to use the @DateTimeFormat annotation.
2012-11-21 20:42:40 -08:00
Phillip Webb 0e2904b71a Document cache and jdbc namespaces
Update the XSD section of the document with details of the cache and
jdbc namespace.

Issue: SPR-9824
2012-11-20 18:12:00 -08:00
Phillip Webb 27210ff3cc Polish XML snippets showing XSD imports
Remove <literal> tag from XML samples to improve the look of the
HTML output.
2012-11-20 18:10:04 -08:00
Phillip Webb c20b22a011 Consistent spelling for US/UK words
Replaced behaviour and summarised with US variants that seem to be
more prevalent in the rest of the document.
2012-11-20 16:39:54 -08:00
Phillip Webb d70762baaf Replace reference to aspectjrt with aspectjweaver
Replace reference to aspectjrt.jar with aspectjweaver.jar since
aspectjrt is a subset of aspectjweaver and the full jar is required
by Spring.

Issue: SPR-8896
2012-11-20 16:06:00 -08:00
Phillip Webb 59b27004de Document @Enable* annotations
Update reference manual with details of Java configuration @Enable*
annotations. Examples of Java style @Configuration is provided
when appropriate alongside existing XML samples.

Several existing @Configuration samples have been changed to placing
the @Enable annotation below the @Configuration annotation.
This has been done to provide consistency with existing Javadoc.

Issue: SPR-9920
2012-11-20 12:17:25 -08:00
Rossen Stoyanchev 77223d7ced Deprecate pre 3.1 @MVC support classes
Issue: SPR-10005
2012-11-20 14:59:01 -05:00
Rossen Stoyanchev 2a11007a04 Add Spring Framework integration with Tiles 3
Tiles 3 has modified packages and classes as well as additional
dependencies, notably "tiles-request-api", which is a request/response
abstraction independent of Servlet and JSP APIs.

In order to have both Tiles 2 and Tiles 3 integrations, the source for
the Tiles 3 integration is in a separate project spring-webmvc-tiles3.
The build process merges the compiled Tiles 3 integration classes into
the spring-webmvc module so in effect it contains both the Tiles 2 and
the Tiles 3 integrations.

This change originated as a pull request at spring-framework-issues:
https://github.com/SpringSource/spring-framework-issues/pull/30

And was additionally updated:
1f64be4aa5

Issue: SPR-8825
2012-11-20 12:24:08 -05:00
Juergen Hoeller f00559c440 Initial preparations for 3.2 RC2 2012-11-08 23:48:08 +01:00
Sam Brannen 9a6ec1b4b5 Increase sleep time in ScheduledATAITests
This commit increases the sleep time in
ScheduledAndTransactionalAnnotationIntegrationTests with the hope of
improving the robustness of the test suite on the CI build server.
2012-11-06 18:33:21 +01:00
Phillip Webb 583819ca5f Fix batch operations sample in reference docs
Remove superfluous code from the sample in section 13.4.3 of the
JDBC reference guide.

Issue: SPR-9937
2012-11-05 14:48:15 -08:00
Sam Brannen 85411be31f Update readme.txt regarding changelog location 2012-11-05 00:43:30 +01:00
Chris Beams 08514e25db Update changelog 2012-11-04 13:32:42 +01:00
Phillip Webb e02c309b77 Update changelog 2012-11-03 17:25:56 -07:00
Rossen Stoyanchev f528c39456 Add UnknownHttpStatusCodeException
This is more specific exception raised instead of RestClientException
when the raw HTTP status code received from the server is not one of
the HttpStatus enum values.

Issue: SPR-9406
2012-11-02 13:47:24 -04:00
Sam Brannen 00220ebab0 Fix typo in changelog 2012-10-31 20:35:11 +01:00
Phillip Webb 6c63271f55 Update changelog 2012-10-31 12:08:44 -07:00
Sam Brannen 5b59a25a59 Update changelog
Added missing JIRA issue IDs.
2012-10-31 18:45:31 +01:00
Juergen Hoeller af56b3b7e3 Extended support for meta-annotations etc 2012-10-31 12:11:12 +01:00
Phillip Webb 7fd18298d1 Update changelog 2012-10-28 12:01:39 -07:00
Sam Brannen 397d20b55a Update changelog
Issue: SPR-9593
2012-10-27 21:10:15 +02:00
Sam Brannen acc8364539 Update changelog
Issue: SPR-9724
2012-10-27 18:29:52 +02:00
Rossen Stoyanchev e14ba9dec3 Add config options for MVC async interceptors
The MVC namespace and the MVC Java config now allow configuring
CallableProcessingInterceptor and DeferredResultProcessingInterceptor
instances.

Issue: SPR-9914
2012-10-26 21:29:54 -04:00
Chris Beams 0bd4dab4e3 Filter @Configuration classes out of LTW test
Moving @EnableMBeanExport and its MBeanExportConfiguration
@Configuration class into context.annotation caused a side effect with
ComponentScanningWithLTWTests, which component scans context.annotation
in order to test LTW behavior. Picking up MBeanExportConfiguration
without proper MBean configuration resulted in a NullPointerException
during test execution.

This commit simply filters out all @Configuration classes from the LTW
test's component-scanning directive.

Issue: SPR-8943
2012-10-26 15:47:11 +02:00
Rossen Stoyanchev c7e7e80a3a Update AbstractView with method to set content type
Before this change View implementations set the response content type
to the fixed value they were configured with.

This change makes it possible to configure a View implementation with
a more general media type, e.g. "application/*+xml", and then set the
response type to the more specific requested media type, e.g.
"application/vnd.example-v1+xml".

Issue: SPR-9807.
2012-10-22 17:23:57 -04:00
Phillip Webb ae2d24808c Close 'beans' tag in MVC namespace documentation
Issue: SPR-9898
2012-10-22 09:56:07 -07:00
Rossen Stoyanchev e329698df5 Update changelog 2012-10-22 12:29:44 -04:00
Rossen Stoyanchev 2f504dda3a Update remoting chapter (minor)
Issue: SPR-9822
2012-10-22 11:04:48 -04:00
Sam Brannen c579cd1ce9 Update changelog regarding major new testing features 2012-10-16 16:07:16 -04:00
Juergen Hoeller 15bf31a09e ResourceDatabasePopulator etc 2012-10-11 00:35:03 +02:00
Juergen Hoeller c020096bbd Further changes for 3.2 RC1 2012-10-10 14:28:56 +02:00
Juergen Hoeller 76e28cb08b Initial changelog for 3.2 RC1 2012-09-24 23:16:49 +02:00
Chris Beams 3bebb23f64 Update changelog 2012-09-11 16:56:49 +02:00
Chris Beams dfe05305e2 Upgrade to JUnit 4.11 snapshot in support of JDK7
Class#getDeclaredMembers returns arbitrary results under JDK7. This
results in non-deterministic execution of JUnit test methods, often
revealing unintended dependencies between methods that rely on a
specific order to succeed.

JUnit 4.11 contains support for predictable test ordering [1], but at
the time of this commit, JUnit 4.11 has not yet been released.
Therefore we are testing against a snapshot version [2], which has been
uploaded to repo.springsource.org [3] for easy access. Note that this
artifact may be removed when JUnit 4.11 goes GA.

 - Care has been taken to ensure that spring-test's compile-time
   dependency on JUnit remains at 4.10. This means that the spring-test
   pom.xml will continue to have an optional <dependency> on JUnit
   4.10, instead of the 4.11 snapshot.

 - For reasons not fully understood, the upgrade to the 4.11 snapshot
   of junit-dep caused NoSuchMethodErrors around certain Hamcrest
   types, particularly CoreMatchers and Matchers. import statements
   have been updated accordingly throughout affected test cases.

 - Runtime errors also occurred around uses of JUnit @Rule and
   ExpectedException. These have been reverted to use simpler
   mechanisms like @Test(expected) in the meantime.

 - Some test methods with order-based dependencies on one another have
   been renamed in order to fall in line with JUnit 4.11's new method
   ordering (as opposed to actually fixing the inter-test
   dependencies). In other areas, the fix was as simple as adding a
   tearDown method and cleaning up state.

 - For no apparent reason, the timeout in AspectJAutoProxyCreatorTests'
   testAspectsAndAdvisorNotAppliedToPrototypeIsFastEnough method begins
   to be exceeded. Prior to this commit the timeout value was 3000 ms;
   on the CI server under Linux/JDK6 and JDK7, the test begins taking
   anywhere from 3500-5500 ms with this commit. It is presumed that
   this is an incidental artifact of the upgrade to JUnit 4.11. In any
   case, there are no changes to src/main in this commit, so this
   should not actually represent a performance risk for Spring
   Framework users. The timeout has been increased to 6000 ms to
   accommodate this situation.

[1]: https://github.com/KentBeck/junit/pull/293
[2]: https://github.com/downloads/KentBeck/junit/junit-dep-4.11-SNAPSHOT-20120805-1225.jar
[3]: https://repo.springsource.org/simple/ext-release-local/junit/junit-dep/4.11.20120805.1225

Issue: SPR-9783
2012-09-11 15:04:56 +02:00
Phillip Webb 8e7622bb8a Fix Windows-related build issues
- Increase max heap size in gradle wrapper.
- Use MockProperties implementation to protect against security
  exceptions.
- Replace windows CRLF with LF in various tests.
- Increase Thread.sleep times to account for lack of precision on
  Windows.

Issue: SPR-9717
2012-09-11 15:04:55 +02:00
Juergen Hoeller 15e384dfd3 updated changelog 2012-09-04 22:40:00 +02:00
Juergen Hoeller bd7a6f658a Typo in ApplicationContextAware and BeanNameAware section
Issue: SPR-9609
2012-08-29 22:00:24 +02:00
Rossen Stoyanchev cb564b287f Provide support for filter registrations
The AbstractDispatcherServletInitializer now provides support for
the registration of filters to be mapped to the DispatcherServlet.
It also sets the asyncSupported flag by default on the
DispatcherServlet and all registered filters.

Issue: SPR-9696
2012-08-28 22:29:23 -04:00
Rossen Stoyanchev 2201dd8c45 Add support for matrix variables
A new @MatrixVariable annotation allows injecting matrix variables
into @RequestMapping methods. The matrix variables may appear in any
path segment and should be wrapped in a URI template for request
mapping purposes to ensure request matching is not affected by the
order or the presence/absence of such variables. The @MatrixVariable
annotation has an optional "pathVar" attribute that can be used to
refer to the URI template where a matrix variable is located.

Previously, ";" (semicolon) delimited content was removed from the
path used for request mapping purposes. To preserve backwards
compatibility that continues to be the case (except for the MVC
namespace and Java config) and may be changed by setting the
"removeSemicolonContent" property of RequestMappingHandlerMapping to
"false". Applications using the  MVC namespace and Java config do not
need to do anything further to extract and use matrix variables.

Issue: SPR-5499, SPR-7818
2012-08-28 13:21:12 -04:00
Rossen Stoyanchev da05b094f5 Polish standard Spring MVC exception handling
Rename ExceptionHandlerSupport to ResponseEntityExceptionHandler and
emphasize the contrast to DefaultHandlerExceptionResovler -- i.e.
one returns a ResponseEntity and relies on message converters while
the other returns a ModelAndView and relies on view resolution.

Issue: SPR-9290
2012-08-27 14:06:06 -04:00
Rossen Stoyanchev b95550489b Add "New in Spring 3.2" section to reference docs 2012-08-23 13:31:32 -04:00
Rossen Stoyanchev b3f0b6e2d6 Fix links in MVC chapter
Issue: SPR-9344
2012-08-22 11:25:29 -04:00
Rossen Stoyanchev af1561634c Allow Errors after @RequestBody and @RequestPart
An @RequestBody or an @RequestPart argument can now be followed by an
Errors/BindingResult argument making it possible to handle validation
errors (as a result of an @Valid annotation) locally within the
@RequestMapping method.

Issue: SPR-7114
2012-08-21 14:34:05 -04:00
Rossen Stoyanchev 1cf4a2facd Add ExceptionHandlerSupport class
The new class is functionally equivalent to the
DefaultHandlerExceptionResolver (i.e. it translates Spring MVC
exceptions to various status codes) but uses an @ExceptionHandler
returning a ResponseEntity<Object>, which means it can be customized to
write error content to the body of the response.

Issue: SPR-9290
2012-08-21 11:32:11 -04:00
Sam Brannen 1f93777bbd Support ApplicationContextInitializers in the TCF
Starting with Spring 3.1 applications can specify
contextInitializerClasses via context-param and init-param in web.xml;
however, there is currently no way to have such initializers invoked in
integration testing scenarios without writing a custom
SmartContextLoader. For comprehensive integration testing it should
therefore be possible to re-use ApplicationContextInitializers in the
Spring TestContext Framework as well.

This commit makes this possible at the @ContextConfiguration level by
allowing an array of ACI types to be specified, and the out-of-the-box
SmartContextLoader implementations invoke the declared initializers at
the appropriate time.

 - Added initializers and inheritInitializers attributes to
   @ContextConfiguration.

 - Introduced support for ApplicationContextInitializers in
   ContextConfigurationAttributes, MergedContextConfiguration, and
   ContextLoaderUtils.

 - MergedContextConfiguration stores context initializer classes as a
   Set and incorporates them into the implementations of hashCode() and
   equals() for proper context caching.

 - ApplicationContextInitializers are invoked in the new
   prepareContext(GenericApplicationContext, MergedContextConfiguration)
   method in AbstractGenericContextLoader, and ordering declared via the
   Ordered interface and @Order annotation is honored.

 - Updated DelegatingSmartContextLoader to support initializers.
   Specifically, a test class may optionally declare neither XML
   configuration files nor annotated classes and instead declare only
   application context initializers. In such cases, an attempt will
   still be made to detect defaults, but their absence will not result
   an an exception.

 - Documented support for application context initializers in Javadoc
   and in the testing chapter of the reference manual.

Issue: SPR-9011
2012-08-20 15:31:46 +02:00
Rossen Stoyanchev e65b930e7a Introduced ControllerAdvice annotation
Classes with this annotation can contain @ExceptionHandler,
@InitBinder, and @ModelAttribute methods that apply to all controllers.
The new annotation is also a component annotation allowing
implementations to be discovered through component scanning.

Issue: SPR-9112
2012-08-14 16:35:37 -04:00
Chris Beams 4e0977ccdd Expand repackaged asm/cglib jars into spring-core
Prior to this change, the repackaged spring-asm and spring-cglib jars
were being included wholesale in the spring-core jar, whereas the
intention was to include the unzipped classfiles.

This change ensures that spring-asm and spring-cglib jars are unzipped
on the fly when creating the spring-core jar.

Issue: SPR-9669
2012-08-11 12:48:45 +02:00
Chris Beams 4691243fb0 Merge branch cbeams/SPR-9669
* SPR-9669:
  Upgrade to CGLIB 3 and inline into spring-core
  Remove spring-asm and inline ASM 4 into spring-core
  Upgrade JarJar to version 1.3
2012-08-10 00:53:23 +02:00
Chris Beams 92500ab902 Upgrade to CGLIB 3 and inline into spring-core
CGLIB 3 has been released in order to depend on ASM 4, which Spring now
depends on internally (see previous commit).

This commit eliminates spring-beans' optional dependency on cglib-nodep
v2.2 and instead repackages net.sf.cglib => org.springframework.cglib
much in the same way we have historically done with ASM.

This change is beneficial to users in several ways:

 - Eliminates the need to manually add CGLIB to the application
   classpath; especially important for the growing number of
   @Configuration class users. Java-based configuration functionality,
   along with proxy-target-class and method injection features now
   work 'out of the box' in Spring 3.2.

 - Eliminates the possibility of conflicts with other libraries that
   may dependend on differing versions of CGLIB, e.g. Hibernate
   3.3.1.ga and its dependency on CGLIB 2.1.3 would easily cause a
   conflict if the application were depending on CGLIB 3 for
   Spring-related purposes.

 - Picks up CGLIB 3's changes to support ASM 4, meaning that CGLIB is
   that much less likely to work well in a Java 7 environment due to
   ASM 4's support for transforming classes with invokedynamic
   bytecode instructions.

On CGLIB and ASM:

  CGLIB's own dependency on ASM is also transformed along the way to
  depend on Spring's repackaged org.springframework.asm, primarily to
  eliminate unnecessary duplication of ASM classfiles in spring-core and
  in the process save around 100K in the final spring-core JAR file size.

  It is coincidental that spring-core and CGLIB currently depend on the
  exact same version of ASM (4.0), but it is also unlikely to change any
  time soon. If this change does occur and versions of ASM drift, then
  the size optimization mentioned above will have to be abandoned. This
  would have no compatibility impact, however, so this is a reasonable
  solution now and for the forseeable future.

On a mysterious NoClassDefFoundError:

  During the upgrade to CGLIB 3.0, Spring test cases began failing due to
  NoClassDefFoundErrors being thrown from CGLIB's DebuggingClassWriter
  regarding its use of asm-util's TraceClassVisitor type. previous
  versions of cglib-nodep, particularly 2.2, did not cause this behavior,
  even though cglib-nodep has never actually repackaged and bundled
  asm-util classes. The reason for these NoClassDefFoundErrors occurring
  now is still not fully understood, but appears to be due to subtle JVM
  bytecode preverification rules. The hypothesis is that due to minor
  changes in DebuggingClassWriter such as additional casts, access to
  instance variables declared in the superclass, and indeed a change in
  the superclass hierarchy, preverification may be kicking in on the
  toByteArray method body, at which point the reference to the missing
  TraceClassVisitor type is noticed and the NCDFE is thrown. For this
  reason, a dummy implementation of TraceClassVisitor has been added to
  spring-core in the org.springframework.asm.util package. This class
  simply ensures that Spring's own tests never result in the NCDFE
  described above, and more importantly that Spring's users never
  encounter the same.

Other changes include:

 - rename package-private Cglib2AopProxy => CglibAopProxy
 - eliminate all 'cglibAvailable' checks, warnings and errors
 - eliminate all 'CGLIB2' language in favor of 'CGLIB'
 - eliminate all mention in reference and java docs of needing to add
   cglib(-nodep) to one's application classpath

Issue: SPR-9669
2012-08-10 00:38:49 +02:00
Chris Beams c16f18a5fd Remove spring-asm and inline ASM 4 into spring-core
ASM 4.0 is generally compatibile with Java 7 classfiles, particularly
including 'invokedynamic' instructions. This is important when
considering that Spring's component-scanning support is internally
ASM-based and it is increasingly likely that component classes having
invokedynamic instructions may be encountered and read by ASM.
This upgrade, then, is primarily preventive in nature.

Changes include:

 - upgrade from ASM 2.2.3 to ASM 4.0

 - adapt to ASM API changes as necessary throughout spring-core,
   resulting in no impact to the public Spring API.

 - remove dedicated spring-asm module

 - use new :spring-core:asmRepackJar task to repackage
   org.objectweb.asm => org.springframework.asm as per usual and write
   repackaged classes directly into spring-core jar

The choice to eliminate the spring-asm module altogether and instead
inline the repackaged classes directly into spring-core is first to
eliminate an otherwise unnecessary second jar. spring-core has a
non-optional dependency on spring-asm meaning it is always on the
application classpath. This change simplifies that situation by
consoliding two jars into one. The second reason for this choice is in
anticipation of upgrading CGLIB to version 3 and inlining it into
spring-core as well. See subsequent commit for details.

Issue: SPR-9669
2012-08-10 00:36:49 +02:00
Andy Clement f5d3cd07e7 Avoid NPE when registering a SpEL MethodFilter
Attempting to register a custom MethodFilter with a
StandardEvaluationContext after invoking setMethodResolvers() with a
custom list of MethodResolver instances results in a
NullPointerException. Based on the current documentation in
StandardEvaluationContext it is unclear what the expected behavior
should be, but either the implementation is broken, or the use case is
unsupported. In either case, allowing a NullPointerException to be
thrown is inappropriate.

This commit documents the fact that the SpEL MethodFilter is intended to
be used with the ReflectiveMethodResolver. Furthermore,
StandardEvaluationContext.registerMethodFilter() now throws an
IllegalStateException if the user attempts to set a filter after having
registered a custom set of resolvers.

Issue: SPR-9621
2012-08-09 23:05:08 +02:00
Andy Clement 75944cc88f Support nested double quotes in SpEL expressions
The Spring Expression Language currently supports nested single quotes
within expressions but not nested double quotes.

The SpEL tokenizer has been modified to support nested double quotes in
the same way it supports single quotes. A sequence of two double quotes
will now be replaced by one when evaluated.

Extra error handling has also been added to report when invalid escaping
is encountered, since SpEL does not support escaping with backslash.

Issue: SPR-9620
2012-08-09 22:12:06 +02:00
Andy Clement 58e6214b7b Support symbolic boolean operators for OR and AND
SpEL typically supports logical operators for boolean expressions
consistent with standard Java language syntax. However, the operators
for logical AND and logical OR are currently only supported as textual
operators. In other words, SpEL does not support the use of && and || as
logical operators.

The SpEL tokenizer has now been modified to recognize && and || as
symbolic boolean operators. The parser has been modified to allow the
use of either the textual or symbolic operators.

Issue: SPR-9614
2012-08-09 21:02:58 +02:00
Sam Brannen 826e565b7c Polish GenericTypeResolver
- renamed resolveParameterizedReturnType() to
   resolveReturnTypeForGenericMethod()
 - fleshed out Javadoc for resolveReturnType() and
   resolveReturnTypeForGenericMethod() regarding declaration of formal
   type variables
 - improved wording in log statements and naming of local variables
   within resolveReturnTypeForGenericMethod()

Issue: SPR-9493
2012-08-05 19:09:38 +02:00
Andy Clement a7418f480c Support case-insensitive null literals in SpEL
Prior to this commit null literals in SpEL expressions had to be
specified as "null" (i.e., all lowercase).

With this commit null literals in SpEL expressions are interpreted in a
case-insensitive manner, analogous to the current support for boolean
literals.

Issue: SPR-9613
2012-08-04 01:47:49 +02:00
Andy Clement e4a926ea3c Modify SpEL Tokenizer to support methods on numbers
When attempting to parse an Integer literal expression such as
42.toString(), SpEL currently throws a SpelParseException with a message
similar to: "EL1041E:(pos 3): After parsing a valid expression, there is
still more data in the expression: 'toString'". The problem here is that
'3.' is currently considered a valid number (including the dot).
However, SpEL succeeds at parsing an equivalent expression for a Double
literal such as 3.14.isInfinite().

To address this issue, the SpEL Tokenizer no longer consumes the
trailing '.' on an integer as part of the integer. So '3.foo()' will now
be parsed as '3' '.' 'foo()' and not '3.' 'foo()' -- which was what
prevented parsing of method invocations on integers. To keep the change
simple, the parser will no longer handle real numbers of the form
'3.e4'. From now on they must include the extra 0 (i.e., '3.0e4').

Issue: SPR-9612
2012-08-04 01:04:29 +02:00
Sam Brannen 015086cb9c Introduce new methods in tx base test classes
Recently new utility methods were added to JdbcTestUtils, and a
JdbcTemplate was introduced in abstract transactional base classes in
the TestContext framework. This presents an easy opportunity to make
these new utility methods available as convenience methods in the base
test classes.

This commit introduces new countRowsInTableWhere() and dropTables()
convenience methods in the abstract transactional base classes in the
TestContext framework. These new methods internally delegate to methods
of the same names in JdbcTestUtils.

Issue: SPR-9665
2012-08-03 22:50:39 +02:00
Sam Brannen 8d9637ada6 Provide JdbcTemplate in tx base classes in the TCF
Since Spring 2.5, the abstract transactional base classes in the
TestContext framework have defined and delegated to a protected
SimpleJdbcTemplate instance variable; however, SimpleJdbcTemplate has
deprecated since Spring 3.1. Consequently, subclasses of
AbstractTransactionalJUnit4SpringContextTests and
AbstractTransactionalTestNGSpringContextTests that use this instance
variable suffer from seemingly unnecessary deprecation warnings.

This commit addresses this issue by introducing a protected JdbcTemplate
instance variable in abstract transactional base classes to replace the
use of the existing SimpleJdbcTemplate. Furthermore, the existing
simpleJdbcTemplate instance variable has been deprecated, and utility
methods in the affected base classes now delegate to JdbcTestUtils
instead of the now deprecated SimpleJdbcTestUtils.

Issue: SPR-8990
2012-08-03 21:59:05 +02:00
Ian Brandt bd0c4b4d99 Deprecate SimpleJdbcTestUtils in favor of JdbcTestUtils
Several static utility methods in SimpleJdbcTestUtils accept an instance
of SimpleJdbcTemplate as an argument; however, SimpleJdbcTemplate has
been deprecated since Spring 3.1 in favor of simply using JdbcTemplate
which now also supports Java 5 language constructs such as var-args.
Consequently, use of such methods from SimpleJdbcTestUtils results in
deprecation warnings without an equivalent API to migrate to.

This commit addresses this issue by migrating all existing methods in
SimpleJdbcTestUtils to JdbcTestUtils. The migrated methods now accept an
instance of JdbcTemplate as an argument, thereby avoiding the
deprecation warnings but maintaining semantic compatibility with the
functionality previous available in SimpleJdbcTestUtils.

In addition, this commit also introduces two new methods:

 - countRowsInTableWhere(): counts the rows in a given table, using
   a provided `WHERE` clause
 - dropTables(): drops the tables with the specified names

Issue: SPR-9235
2012-08-03 20:55:09 +02:00
Sam Brannen f49b22c78f Introduce MockEnvironment in the spring-test module
For legacy reasons, a MockEnvironment implementation already exists in multiple places within Spring's test suite; however, it is not available to the general public.

This commit promotes MockEnvironment to a first-class citizen in the spring-test module, alongside the existing MockPropertySource.

In addition, the following house cleaning has been performed.

 - deleted MockPropertySource from the spring-expression module
 - deleted MockEnvironment from the "spring" integration testing module
 - updated test copies of MockPropertySource and MockEnvironment
 - documented MockEnvironment and MockPropertySource in the testing
   chapter of the reference manual

Issue: SPR-9492
2012-07-28 20:10:21 +02:00
Sam Brannen 2b7a629068 Support TransactionManagementConfigurer in the TCF
Currently the Spring TestContext Framework looks up a
PlatformTransactionManager bean named "transactionManager". The exact
name of the bean can be overridden via @TransactionConfiguration or
@Transactional; however, the bean will always be looked up 'by name'.

The TransactionManagementConfigurer interface that was introduced in
Spring 3.1 provides a programmatic approach to specifying the
PlatformTransactionManager bean to be used for annotation-driven
transaction management, and that bean is not required to be named
"transactionManager". However, as of Spring 3.1.2, using the
TransactionManagementConfigurer on a @Configuration class has no effect
on how the TestContext framework looks up the transaction manager.
Consequently, if an explicit name or qualifier has not been specified,
the bean must be named "transactionManager" in order for a transactional
integration test to work.

This commit addresses this issue by refactoring the
TransactionalTestExecutionListener so that it looks up and delegates to
a single TransactionManagementConfigurer as part of the algorithm for
determining the transaction manager.

Issue: SPR-9604
2012-07-28 01:24:32 +02:00
Sam Brannen f21fe33e74 Support single, unqualified tx manager in the TCF
TransactionalTestExecutionListener currently requires that the
PlatformTransactionManager bean be named "transactionManager" by
default. Otherwise, the bean name can only be overridden via the
transactionManager attribute of @TransactionConfiguration or the value
attribute of @Transactional.

However, if there is only a single PlatformTransactionManager in the
test's ApplicationContext, then the requirement to specify the exact
name of that bean (or to name it exactly "transactionManager") is often
superfluous.

This commit addresses this issue by refactoring the
TransactionalTestExecutionListener so that it is comparable to the
algorithm for determining the transaction manager used in
TransactionAspectSupport for "production" code. Specifically, the TTEL
now uses the following algorithm to retrieve the transaction manager.

 - look up by type and qualifier from @Transactional
 - else, look up by type and explicit name from
   @TransactionConfiguration
 - else, look up single bean by type
 - else, look up by type and default name from @TransactionConfiguration

Issue: SPR-9645
2012-07-28 00:06:46 +02:00
Sam Brannen 37dc211f58 Support named dispatchers in MockServletContext
Currently the getNamedDispatcher(String) method of MockServletContext
always returns null. This poses a problem in certain testing scenarios
since one would always expect at least a default Servlet to be present.
This is specifically important for web application tests that involve
the DefaultServletHttpRequestHandler which attempts to forward to the
default Servlet after retrieving it by name. Furthermore, there is no
way to register a named RequestDispatcher with the MockServletContext.

This commit addresses these issues by introducing the following in
MockServletContext.

 - a new defaultServletName property for configuring the name of the
   default Servlet, which defaults to "default"
 - named RequestDispatchers can be registered and unregistered
 - a MockRequestDispatcher is registered for the "default" Servlet
   automatically in the constructor
 - when the defaultServletName property is set to a new value the
   the current default RequestDispatcher is unregistered and replaced
   with a MockRequestDispatcher for the new defaultServletName

Issue: SPR-9587
2012-07-26 03:06:07 +02:00
Rossen Stoyanchev 64d939bb16 Add ContentNegotiationManagerFactoryBean
The new FactoryBean facilitates the creation of a
ContentNegotiationManager in XML configuration.

Issue: SPR-8420
2012-07-21 06:16:42 -04:00
Rossen Stoyanchev 028e15faa3 Add options to configure content negotiation
The MVC Java config and the MVC namespace now support options to
configure content negotiation. By default both support checking path
extensions first and the "Accept" header second. For path extensions
.json, .xml, .atom, and .rss are recognized out of the box if the
Jackson, JAXB2, or Rome libraries are available. The ServletContext
and the Java Activation Framework may be used as fallback options
for path extension lookups.

Issue: SPR-8420
2012-07-20 21:32:02 -04:00
Rossen Stoyanchev 92759ed1f8 Add exclude patterns for mapped interceptors
Add the ability provide exclude patterns for mapped interceptors in the
MVC namespace and in the MVC Java config.

Issue: SPR-6570
2012-07-20 14:47:46 -04:00
Rossen Stoyanchev 6cc512b51c Ensure async Callables are in sync with the call stack
After this change each call stack level pushes and pops an async
Callable to ensure the AsyncExecutionChain is in sync with the
call stack. Before this change, a controller returning a "forward:"
prefixed string caused the AsyncExecutionChain to contain a
extra Callables that did not match the actual call stack.

Issue: SPR-9611
2012-07-20 12:50:01 -04:00
Sam Brannen 33a3681975 Fix DeferredResult typo in changelog 2012-07-18 13:08:59 -04:00
Rossen Stoyanchev d3d00696a4 Create StandardServletAsyncWebRequest via reflection
Issue: SPR-9500
2012-07-18 10:02:15 -04:00
Rossen Stoyanchev eab6e1d134 Parameterize DeferredResult
Issue: SPR-9579
2012-07-18 09:43:03 -04:00
Rossen Stoyanchev 55bd99fa16 Fix typos in Spring MVC chapter of reference docs 2012-07-17 16:46:50 -04:00
Rossen Stoyanchev 67a05e4185 Update section on exception handling MVC chapter
Update section on exception handling in Spring MVC chapter to include
more guidance on exception handling when implementing a REST API.

Issue: SPR-9290
2012-07-10 19:13:10 -04:00
Rossen Stoyanchev a1b7a314c1 Add BindException to DefaultHandlerExceptionResolver
Previously DefaultHandlerExceptionResolver did not handle BindException
but after this change it does. A BindException is raised when an
@ModelAttribute annotated argument is not followed by a BindingResult
argument. Hence this is unlikely to affect browser rendering.
For programmatic clients however this change ensures an unhandled
BindException is at least turned into a 400 error.

Issue: SPR-9310
2012-07-10 17:32:13 -04:00
Rossen Stoyanchev e860fa9a8b Move feed message converters ahead of jackson/jaxb2
The Atom/RSS message converters are now registered ahead of the
Jackson and the JAXB2 message converters by default. Since the Atom
and RSS converters convert to and from very specific object types
Feed and Channel respectively, that shouldn't introduce any regressions
and will work more intuitively when the requested media type is "*/*".

Issue: SPR-9054
2012-07-10 17:12:06 -04:00
Rossen Stoyanchev c846198e46 Add support for global @ExceptionHandler methods
Before this change @ExceptionHandler methods could be located in and
apply locally within a controller. The change makes it possible to have
such methods applicable globally regardless of the controller that
raised the exception.

The easiest way to do that is to add them to a class annotated with
`@ExceptionResolver`, a new annotation that is also an `@Component`
annotation (and therefore works with component scanning). It is also
possible to register classes containing `@ExceptionHandler` methods
directly with the ExceptionHandlerExceptionResolver.

When multiple `@ExceptionResolver` classes are detected, or registered
directly, the order in which they're used depends on the the `@Order`
annotation (if present) or on the value of the order field (if the
Ordered interface is implemented).

Issue: SPR-9112
2012-07-09 17:27:03 -04:00
Juergen Hoeller ccd2da37ce preparations for 3.2 M2 2012-07-06 22:47:46 +02:00
Rossen Stoyanchev a4240d2864 Add defaultCharset field to StringHttpMessageConverter
Before this change the StringHttpMessageConverter used a fixed charset
"ISO-8859-1" if the requested content type did not specify one. This
change adds a defaultCharset field and a constructor to configure it in
StringHttpMessageConverter.

Issue: SPR-9487
2012-07-05 15:53:49 -04:00
Juergen Hoeller 4d297b475c preparations for 3.2 M2 2012-07-05 00:50:35 +02:00
Rossen Stoyanchev 4fd7645efd Enable smart suffix pattern match for request mapping
Following the introduction of ContentNegotiationManager that allows,
among other things, to configure the file extensions to use for content
negotiation, this change adds "smart" suffix pattern match that matches
against the configured file extensions only rather than against any
extension.

Given the request mapping "/jobs/{jobName}" and one configured file
extension ("json"), a request for "/jobs/my.job" will select the
pattern "/jobs/{jobName}" while a request for "/jobs/my.job.json" will
select the pattern "/jobs/{jobName}.json". Previously, both requests
would have resulted in the pattern "/jobs/{jobName}.*".

Issue: SPR-7632, SPR-8474
2012-06-25 21:30:10 -04:00
Rossen Stoyanchev a0747458e7 Add support for HTTP PATCH method
The HTTP PATCH method is now supported whereever HTTP methods are used.
Annotated controllers can be mapped to RequestMethod.PATCH.

On the client side the RestTemplate execute(..) and exchange(..)
methods can be used with HttpMethod.PATCH. In terms of HTTP client
libraries, Apache HttpComponents HttpClient version 4.2 or later is
required (see HTTPCLIENT-1191). The JDK HttpURLConnection does not
support the HTTP PATCH method.

Issue: SPR-7985
2012-06-22 16:57:22 -04:00
Rossen Stoyanchev f05e2bc56f Add abstractions for content negotiation
Introduced ContentNeogtiationStrategy for resolving the requested
media types from an incoming request. The available implementations
are based on path extension, request parameter, 'Accept' header,
and a fixed default content type. The logic for these implementations
is based on equivalent options, previously available only in the
ContentNegotiatingViewResolver.

Also in this commit is ContentNegotiationManager, the central class to
use when configuring content negotiation options. It accepts one or
more ContentNeogtiationStrategy instances and delegates to them.

The ContentNeogiationManager can now be used to configure the
following classes:

- RequestMappingHandlerMappingm
- RequestMappingHandlerAdapter
- ExceptionHandlerExceptionResolver
- ContentNegotiatingViewResolver

Issue: SPR-8410, SPR-8417, SPR-8418,SPR-8416, SPR-8419,SPR-7722
2012-06-22 11:55:46 -04:00
Sam Brannen 027e49c58a Document default scripts for embedded databases
The reference manual currently documents the wrong file name for the
default data SQL script used by EmbeddedDatabaseBuilder. In addition,
the testing chapter of the reference manual does not link to the testing
section of the JDBC chapter.

 - Updated the "Testing data access logic with an embedded database"
   section of the reference manual appropriately.
 - Added a new paragraph to the "JDBC Testing Support" section of the
   testing chapter which cross references the "Testing data access logic
   with an embedded database" section.

Issue: SPR-9467
2012-06-19 20:48:07 +02:00
Sam Brannen 5eae22abb8 Document SPR-9493 in the changelog
Issue: SPR-9493
2012-06-19 20:13:46 +02:00
Chris Beams de04d9c654 Fix typo in MessageSource reference docs
Issue: SPR-5022
2012-06-19 11:56:05 +02:00
Dmitry Katsubo aa415d7c0c BeanFactory for configuring a Jackson ObjectMapper
The BeanFactory makes it easier to configure a customized Jackson
ObjectMapper (for example enable/disable certain features).
This bean factory is usually used with
MappingJacksonHttpMessageConverter or MappingJacksonJsonView.
See JavaDoc for examples.

Issue: SPR-9125
2012-06-18 17:12:09 -04:00
Rossen Stoyanchev ab4952a959 Raise RestClientException for unknown status codes
HttpStatus cannot be created with an unknown status code. If a server
returns a status code that's not in the HttpStatus enum values, an
IllegalArgumentException is raised. Rather than allowing it to
propagate as such, this change ensures the actual exception raised is
a RestClientException.

Issue: SPR-9406
2012-06-13 08:27:16 -04:00
Sam Brannen 369d77bdf0 spring-test module now depends on junit:junit-dep
The junit:junit Maven artifact includes a bundled version of hamcrest
core. For projects that depend on later versions of hamcrest this causes
significant issues in terms of dependency management.

The spring-test module now depends on junit:junit-dep, thus allowing
developers to better manage their test dependencies on a more fine
grained level.

Also tidied up dependency issues regarding hamcrest-core and
hamcrest-all across the build.

Issue: SPR-6966
2012-06-10 02:39:27 +02:00
Chris Beams f582974b0c Update 3.2 M1 changelog 2012-05-28 11:08:41 +03:00
Sam Brannen 155b88ffce Improve dependency management for spring-test
In Spring 3.1 the spring-test Maven artifact did not have a required
dependency on spring-core, but there is practically no part of
spring-test that can be used without spring-core. Most test utilities
that are intended to be stand-alone utilities in fact use utility
classes from spring-core (e.g., ReflectionTestUtils). Even some of the
web mocks/stubs use spring-core (e.g., DelegatingServletInputStream).

In addition, the current Gradle build configuration for the spring-test
module is very simplistic -- in that it does not explicitly list any
optional dependencies such as the Servlet and Portlet APIs -- and it
defines a 'compile' dependency on spring-webmvc-portlet.

The resulting Maven dependencies in the generated POM are therefore not
what a typical consumer of the spring-test artifact would reasonably
expect.

To address these issues, the Gradle build configuration for the
spring-test module now explicitly defines the following 'compile'
dependencies:

 - spring-core
 - spring-webmvc, optional
 - spring-webmvc-portlet, optional
 - junit, optional
 - testng, optional
 - servlet-api, optional
 - jsp-api, optional
 - portlet-api, optional
 - activation, provided

The only required dependency is now spring-core; all other dependencies
are 'optional'.

Issue: SPR-8861
2012-05-28 11:08:41 +03:00
Chris Beams 2a2b6eef91 Introduce ConfigurableWebEnvironment
Changes introduced in Spring 3.1 for Environment support inadvertently
established a cyclic dependency between the
org.springframework.web.context and
org.springframework.web.context.support packages, specifically through
web.context.ContextLoader's invocation of
web.context.support.WebApplicationContextUtils#initServletPropertySources.

This commit introduces ConfigurableWebEnvironment to break this cyclic
dependency. All web.context.ConfigurableWebApplicationContext types now
return web.context.ConfigurableWebEnvironment from their #getEnvironment
methods; web.context.support.StandardServletEnvironment now implements
ConfigurableWebEnvironment and makes the call to
web.context.support.WebApplicationContextUtils#initServletPropertySources
within its implementation of #initPropertySources. This means that
web.context.ContextLoader now invokes
web.context.ConfigurableWebEnvironment#initPropertySources instead of
web.context.support.WebApplicationContextUtils#initServletPropertySources
and thus the cycle is broken.

Issue: SPR-9439
2012-05-26 14:35:57 +03:00
Chris Beams 53673d6c59 Support initial delay attribute for scheduled tasks
java.util.concurrent's ScheduledExecutorService and its #schedule*
methods allow for an 'initialDelay' parameter in milliseconds.
Similarly, Spring's TaskExecutor abstraction allows for a concrete
'startTime' expressed as a Date. However, Spring's <task:scheduled> XML
element and @Scheduled annotation have, to date, not allowed for an
initial delay parameter that can be propagated down to the underlying
TaskScheduler/ScheduledExecutorService.

This commit introduces initial-delay and #initialDelay attributes to
task:scheduled and @Scheduled respectively, both indicating the number
of milliseconds to wait before the first invocation of the method in
question. Specifying a delay in this fashion is only valid in
conjunction with fixed-rate and fixed-delay tasks (i.e. not with cron
or trigger tasks).

The principal changes required to support these new attributes lie in
ScheduledTaskRegistrar, which previously supported registration of
tasks in the form of a Runnable and a Long parameter indicating (in the
case of fixed-rate and fixed-delay tasks), the interval with which the
task should be executed. In order to accommodate a third (and optional)
'initialDelay' parameter, the IntervalTask class has been added as a
holder for the Runnable to be executed, the interval in which to run
it, and the optional initial delay. For symmetry, a TriggerTask and
CronTask have also been added, the latter subclassing the former. And a
'Task' class has been added as a common ancestor for all the above.

One oddity of the implementation is in the naming of the new
setters in ScheduledTaskRegistrar. Prior to this commit, the setters
were named #setFixedDelayTasks, #setFixedRateTasks, etc, each accepting
a Map<Runnable, long>. In adding new setters for each task type, each
accepting a List<IntervalTask>, List<CronTask> etc, naturally the
approach would be to use method overloading and to introduce methods
of the same name but with differing parameter types. Unfortunately
however, Spring does not support injection against overloaded methods
(due to fundamental limitations of the underlying JDK Introspector).
This is not a problem when working with the ScheduledTaskRegistrar
directly, e.g. from within a @Configuration class that implements
SchedulingConfigurer, but is a problem from the point of view of the
ScheduledTasksBeanDefinitionParser which parses the <task:scheduled>
element - here the ScheduledTaskRegistrar is treated as a Spring bean
and is thus subject to these limitations. The solution to this problem
was simply to avoid overloading altogether, thus the naming of the new
methods ending in "List", e.g. #setFixedDelayTasksList, etc. These
methods exist primarily for use by the BeanDefinitionParser and are
not really intended for use by application developers. The Javadoc for
each of the new methods makes note of this.

Issue: SPR-7022
2012-05-22 17:48:00 +03:00
Chris Beams 4d5fe57a08 Polish scheduled task execution infrastructure
In anticipation of substantive changes required to implement "initial
delay" support in the <task:scheduled> element and @Scheduled
annotation, the following updates have been made to the components and
infrastructure supporting scheduled task execution:

 - Fix code style violations
 - Fix compiler warnings
 - Add Javadoc where missing, update to use {@code} tags, etc.
 - Organize imports to follow conventions
2012-05-22 17:47:43 +03:00
Arjen Poutsma f64c13ad2e Add convenient WebAppInitializer base classes
This commit introduces three abstract WebApplicationInitializers, to be
used in the typical setup of a Spring-based web application.

 - AbstractContextLoaderInitializer provides an abstract base class for
   registering a ContextLoaderListener.

 - AbstractDispatcherServletInitializer provides an abstract base class
   for registering a DispatcherServlet, with an optional root context.

 - AbstractAnnotationConfigDispatcherServletInitializer provides an
   abstract base class for registering a DispatcherServlet and optional
   ContextLoaderListener based on annotated (e.g. @Configuration)
   classes.

Issue: SPR-9300
2012-05-22 17:31:55 +03:00
Chris Beams ed0576c181 Support executor qualification with @Async#value
Prior to this change, Spring's @Async annotation support was tied to a
single AsyncTaskExecutor bean, meaning that all methods marked with
@Async were forced to use the same executor. This is an undesirable
limitation, given that certain methods may have different priorities,
etc. This leads to the need to (optionally) qualify which executor
should handle each method.

This is similar to the way that Spring's @Transactional annotation was
originally tied to a single PlatformTransactionManager, but in Spring
3.0 was enhanced to allow for a qualifier via the #value attribute, e.g.

  @Transactional("ptm1")
  public void m() { ... }

where "ptm1" is either the name of a PlatformTransactionManager bean or
a qualifier value associated with a PlatformTransactionManager bean,
e.g. via the <qualifier> element in XML or the @Qualifier annotation.

This commit introduces the same approach to @Async and its relationship
to underlying executor beans. As always, the following syntax remains
supported

  @Async
  public void m() { ... }

indicating that calls to #m will be delegated to the "default" executor,
i.e. the executor provided to

  <task:annotation-driven executor="..."/>

or the executor specified when authoring a @Configuration class that
implements AsyncConfigurer and its #getAsyncExecutor method.

However, it now also possible to qualify which executor should be used
on a method-by-method basis, e.g.

  @Async("e1")
  public void m() { ... }

indicating that calls to #m will be delegated to the executor bean
named or otherwise qualified as "e1". Unlike the default executor
which is specified up front at configuration time as described above,
the "e1" executor bean is looked up within the container on the first
execution of #m and then cached in association with that method for the
lifetime of the container.

Class-level use of Async#value behaves as expected, indicating that all
methods within the annotated class should be executed with the named
executor. In the case of both method- and class-level annotations, any
method-level #value overrides any class level #value.

This commit introduces the following major changes:

 - Add @Async#value attribute for executor qualification

 - Introduce AsyncExecutionAspectSupport as a common base class for
   both MethodInterceptor- and AspectJ-based async aspects. This base
   class provides common structure for specifying the default executor
   (#setExecutor) as well as logic for determining (and caching) which
   executor should execute a given method (#determineAsyncExecutor) and
   an abstract method to allow subclasses to provide specific strategies
   for executor qualification (#getExecutorQualifier).

 - Introduce AnnotationAsyncExecutionInterceptor as a specialization of
   the existing AsyncExecutionInterceptor to allow for introspection of
   the @Async annotation and its #value attribute for a given method.
   Note that this new subclass was necessary for packaging reasons -
   the original AsyncExecutionInterceptor lives in
   org.springframework.aop and therefore does not have visibility to
   the @Async annotation in org.springframework.scheduling.annotation.
   This new subclass replaces usage of AsyncExecutionInterceptor
   throughout the framework, though the latter remains usable and
   undeprecated for compatibility with any existing third-party
   extensions.

 - Add documentation to spring-task-3.2.xsd and reference manual
   explaining @Async executor qualification

 - Add tests covering all new functionality

Note that the public API of all affected components remains backward-
compatible.

Issue: SPR-6847
2012-05-20 15:18:10 +03:00
Sam Brannen e71cd06a46 Doc. usage of JSR-250 lifecycle annotations in TCF
The reference manual previously did not mention the applicability of
JSR-250 lifecycle annotations within the TestContext framework. The
lacking documentation here has lead to misunderstandings of the support
provided for @PostConstruct and @PreDestroy in test classes.

The testing chapter of the reference manual has therefore been updated
to explicitly define the limited support for these annotations.

Also introduced Jsr250LifecycleTests for empirical verification of the 
expected behavior.

Issue: SPR-4868
2012-05-19 04:03:40 +02:00
Sam Brannen 49966258f1 Polish doc for 'annotated class' support in TCF
Revised the content in the @ContextConfiguration annotation section.

Issue: SPR-9401
2012-05-18 17:15:38 +02:00
Sam Brannen 504cdf498e Update documentation of 'annotated class' support in the TCF
Updated the testing chapter of the reference manual to refer to 
'annotated classes' instead of 'configuration classes' where 
appropriate.

Also revised the content and examples in the @ContextConfiguration 
annotation section, mentioned Gradle, and reformatted the entire text.

Issue: SPR-9401
2012-05-18 04:33:40 +02:00
Rossen Stoyanchev 77ae101402 Add required flag to @RequestBody
If true and there is no body => HttpMessageNotReadableException
If false and there is no body, the argument resolves to null.

Issue: SPR-9239
2012-05-17 17:48:48 -04:00
Rossen Stoyanchev 57307a0b2e Decode path vars when url decoding is turned off
When URL decoding is turned off in AbstractHandlerMapping, the
extracted path variables are also not encoded. Turning off URL decoding
may be necessary for request mapping to work correctly when the path
may contain the (encoded) special character '/'. At the same time there
is no good reason not to leave path variables encoded. This change
ensures path variables are encoded when URL decoding is turned off.

Issue: SPR-9098
2012-05-17 16:01:20 -04:00
Rossen Stoyanchev 01a9dd9772 Add option to set Content-Length in JSON Views
MappingJackson2JsonView and MappingJacksonJsonView now provide an
option that will set the Content-Length header of JSON responses.
Use of the option implies buffering of the response and it must be
enabled explicitly.

Issue: SPR-7866
2012-05-15 18:10:24 -04:00
Rossen Stoyanchev 2af294ab26 Add MessageCodesResolver hook to WebMvcConfigurer
This change makes it possible to provide a custom MessageCodesResolver
through the MVC Java config whether using @EnableWebMvc and extending
WebMVcConfigurerAdapter or sub-classing directly from
WebMvcConfigurationSupport.

Issue: SPR-9223
2012-05-15 17:11:28 -04:00
Chris Beams 9c223c1780 Fix broken link to JavaBean customization tutorial
Issue: SPR-9408
2012-05-15 22:51:46 +03:00
Rossen Stoyanchev bdc3599d3d Add CompositeRequestCondition
The new type makes it easier providing multiple custom request mapping
conditions via setters on RequestMappingHandlerMapping.

Issue: SPR-9350
2012-05-15 13:16:06 -04:00
Rossen Stoyanchev fbb2103e4d Add "excludedExceptions" to SimpleUrlHandlerMapping
The new property can be used to ignore specific exceptions that may
otherwise be matched by the "exceptionMappings" property or resolved
through the defaultErrorView.

Issue: SPR-5193
2012-05-15 13:16:06 -04:00
Sam Brannen 1167155182 Update reference manual regarding upgrade to JUnit 4.10 2012-05-15 14:40:13 +02:00
Sam Brannen 50d4ebcc71 Fix typo in section id 2012-05-15 14:25:10 +02:00
Oliver Gierke 2a75c57d3c Add missing section ids in reference documentation
Add missing id attributes to <section> elements in the reference
documentation to ensure stable anchor links in HTML output.

Issue: SPR-9346
2012-05-15 13:23:32 +03:00
Rossen Stoyanchev 1d0e484eac Support access to all URI vars via @PathVariable Map
Issue: SPR-9289
2012-05-14 16:01:16 -04:00
Rossen Stoyanchev 698d004260 Deprecate HttpStatus codes 419, 420, 421
Issue: SPR-7942
2012-05-14 14:34:33 -04:00
Chin Huang f1c062fe9e Fix typos in Reference Documentation 2012-05-12 00:53:51 -04:00
Rossen Stoyanchev d52fc3bd2f Prevent response updates if @ResponseStatus has reason
When @ResponseStatus has a reason and servletResponse.sendError() is
called, the response is committed and should no longer be written to.
After this change, the ServletInvocableHandlerMethod will mark the
response fully handled and will ignore any non-null return values.

Issue: SPR-9159
2012-05-11 17:41:14 -04:00
Sam Brannen 897f6d6c68 Update changelog regarding upgrade to JUnit 4.10 and TestNG 6.5.2 2012-05-11 21:02:25 +02:00
Rossen Stoyanchev 982cb2f258 Fix content negotiation issue with sort by q-value
Before this fix the q-value of media types in the Accept header were
ignored when using the new RequestMappingHandlerAdapter in combination
with @ResponseBody and HttpMessageConverters.

Issue: SPR-9160
2012-05-11 14:43:58 -04:00
Rossen Stoyanchev 816c1f47a4 Translate EOF to HttpMessageNotReadableException
The MappingJacksonHttpMessageConverter now catches all IOException
types raised while reading JSON and translates them into
HttpMessageNotReadableException.

Issue: SPR-9238
2012-05-10 17:17:29 -04:00
Rossen Stoyanchev d7efc0db80 Detect controller methods via InitializingBean hook
Previously RequestMappingHandlerMapping detected @RequestMapping
methods through an initApplicationContext() hook. However, the
HandlerMapping may not have been fully set up with all its
dependencies at that point including settings like useSuffixPattern
and others.

This change moves the detection @RequestMapping methods to an
InitializingBean.afterPropertiesSet() hook.

Issue: SPR-9371
2012-05-10 16:42:36 -04:00
Rossen Stoyanchev c499df2315 Fix issue with resolving Errors controller argument
The ErrorsMethodArgumentResolver expects the preceding @ModelAttribute
in the controller method signature to be the last one added in the
model -- an assumption that can break if a model attribute is added
earlier (e.g. through a @ModelAttribute method) and more attributes
are added as well. This fix ensures when an @ModelAttribute is resolved
as a controller method argument it has the highest index in the model.

Issue: SPR-9378
2012-05-10 16:01:14 -04:00
Rossen Stoyanchev e63ca04fdb Add Jackson 2 HttpMessageConverter and View
Jackson 2 uses completely new package names and new maven artifact ids.
This change adds Jackson 2 as an optional dependency and also provides
MappingJackson2HttpMessageConverter and MappingJackson2JsonView for use
with the new version.

The MVC namespace and the MVC Java config detect and use
MappingJackson2HttpMessageConverter if Jackson 2 is present.
Otherwise if Jackson 1.x is present,
then MappingJacksonHttpMessageConverter is used.

Issue: SPR-9302
2012-05-09 13:07:25 -04:00
Rossen Stoyanchev a33fe6fa0a Fix issue with encoded params in UriComponentsBuilder
The fromUri method of UriComponentsBuilder used uri.getXxx() methods,
which decode the URI parts causing URI parsing issues. The same method
now uses uri.getRawXxx().

Issue: SPR-9317
2012-05-01 16:10:38 -04:00
Rossen Stoyanchev 3642b0f365 Initial cut of Servlet 3.0 based async support
From a programming model perspective, @RequestMapping methods now
support two new return value types:

* java.util.concurrent.Callable - used by Spring MVC to obtain the
return value asynchronously in a separate thread managed transparently
by Spring MVC on behalf of the application.
* org.springframework.web.context.request.async.DeferredResult - used
by the application to produce the return value asynchronously in a
separate thread of its own choosing.

The high-level idea is that whatever value a controller normally
returns, it can now provide it asynchronously, through a Callable or
through a DeferredResult, with all remaining processing --
@ResponseBody, view resolution, etc, working just the same but
completed outside the main request thread.

From an SPI perspective, there are several new types:

* AsyncExecutionChain - the central class for managing async request
processing through a sequence of Callable instances each representing
work required to complete request processing asynchronously.
* AsyncWebRequest - provides methods for starting, completing, and
configuring async request processing.
* StandardServletAsyncWebRequest - Servlet 3 based implementation.
* AsyncExecutionChainRunnable - the Runnable used for async request
execution.

All spring-web and spring-webmvc Filter implementations have been
updated to participate in async request execution.
The open-session-in-view Filter and interceptors implementations in
spring-orm will be updated in a separate pull request.

Issue: SPR-8517
2012-04-18 16:36:09 -04:00
Chris Beams 57b89e0388 Fix typo in ApplicationContext reference doc 2012-04-16 13:36:12 +03:00
Chris Beams 0ab9e9a0c6 Upgrade AspectJ from 1.6.8 to 1.6.12
- Spring remains compatible against AJ version 1.6.8, but is now
   compiling and testing against 1.6.12

 - Encountered what appears to be an AJ bug introduced in 1.6.10: an
   assertion in org.aspectj.weaver.UnresolvedType causes a false
   negative failure when encountering org.springframework.io.Resource
   arrays, e.g. "[org.springframework.io.Resource@xxx". This problem
   has been reported to the AJ team and in the meantime, the recommended
   workaround is to disable assertions either completely, or at least
   selectively with

       -disableassertions:org.aspectj.weaver.UnresolvedType

Issue: SPR-7989, SPR-9272
2012-04-14 19:05:20 +03:00
Chris Beams f6003b5102 Fix typo in reference documentation
Issue: SPR-9321
2012-04-13 20:41:37 +03:00
Rossen Stoyanchev cfe2af7690 Use the type of the actual return value in @MVC
The new @MVC support classes select a HandlerMethodArgumentResolver
and a HandlerMethodReturnValueHandler statically, i.e. based on
the signature of the method, which means that a controller method
can't declare a more general return type like Object but actually
return a more specific one, e.g.  String vs RedirectView, and
expect the right handler to be used.

The fix ensures that a HandlerMethodReturnValueHandler is selected
based on the actual return value type, which is something that was
supported with the old @MVC support classes. One consequence
of the change is the selected HandlerMethodReturnValueHandler can
no longer be cached but that matches the behavior of the old
@MVC support classes.

Issues: SPR-9218
2012-04-06 16:50:22 -04:00
Rossen Stoyanchev ca8b98e947 Fix issue with parsing media types
Invalid Content-Type or Accept header values previously resulted in the
IllegalArgumentException getting propagated. After this change such
errors are detected and generally treated as a "no match", which
may for example result in a 406 in the case of the Accept header.

Issue: SPR-9148
2012-04-02 17:36:23 -04:00
Stevo Slavic 924c869b8a Remove note on singleton-scoped proxy raising BCE
Before this change bean scopes chapter in Spring reference documentation
had a note which mentioned that creating a scoped proxy for singleton-
or prototype-scoped beans will throw BeanCreationException.

This is no longer the case and this change removes the mentioned note.

Issue: SPR-7940
2012-03-01 12:29:40 +01:00
Phani Kandula 00d9c3f5e8 Fix typo in spring:eval taglib reference doc
- Replace 'javascriptEncoding' with 'javaScriptEscape'

Issue: SPR-9188
2012-03-01 12:12:52 +01:00
Phani Kandula 6c602d7bbc Fix typo in ApplicationContext reference doc
- Add missing '=' sign in sample code for section 4.2.3

Issue: SPR-8856
2012-03-01 12:12:45 +01:00
Chris Beams 37d547c506 Sync with 3.1.x
* 3.1.x:
  Warn re Environment construction and instance vars
  Disallow empty @PropertySource(value = {})
  Fix @PropertySource bug with multiple values
  final preparations for 3.1.1 release
  added "receive-timeout" attribute to "jms:listener-container" element
2012-02-20 14:19:04 +01:00
Chris Beams 3e81482760 Sync with 3.1.x
* 3.1.x:
  Demonstrate use of @Configuration as meta-annotation
  Prune dead code from JmsTransactionManager#doBegin
  Apply @Configuration BeanNameGenerator consistently
  Improve @Configuration bean name discovery
  Fix infinite recursion bug in nested @Configuration
  Polish static imports
  Minor fix in ServletResponseMethodArgumentResolver
  extracted ResourceUtils.useCachesIfNecessary(URLConnection) method (SP
  prepared for 3.1.1 release
  CustomSQLExceptionTranslatorRegistry/Registrar etc
  revised CustomSQLExceptionTranslatorRegistry/Registrar method naming
  use custom InputStream traversal instead of a full byte array (SPR-911
  PathMatchingResourcePatternResolver preserves caching for JNLP jar con
  Resource "contentLength()" implementations work with OSGi bundle resou
  fixed MethodInvokingJobDetailFactoryBean for compatibility with Quartz
  fixed MethodInvokingJobDetailFactoryBean for compatibility with Quartz
2012-02-16 13:00:28 +01:00
Chris Beams ee36c80ca9 Sync with 3.1.x
* 3.1.x: (61 commits)
  Compensate for changes in JDK 7 Introspector
  Avoid 'type mismatch' errors in ExtendedBeanInfo
  Polish ExtendedBeanInfo and tests
  Infer AnnotationAttributes method return types
  Minor fix in MVC reference doc chapter
  Hibernate 4.1 etc
  TypeDescriptor equals implementation accepts annotations in any order
  "setBasenames" uses varargs now (for programmatic setup; SPR-9106)
  @ActiveProfiles mechanism works with @ImportResource as well (SPR-8992
  polishing
  clarified Resource's "getFilename" method to consistently return null
  substituteNamedParameters detects and unwraps SqlParameterValue object
  Replace spaces with tabs
  Consider security in ClassUtils#getMostSpecificMethod
  Adding null check for username being null.
  Improvements for registering custom SQL exception translators in app c
  SPR-7680 Adding QueryTimeoutException to the DataAccessException hiera
  Minor polish in WebMvcConfigurationSupport
  Detect overridden boolean getters in ExtendedBeanInfo
  Polish ExtendedBeanInfoTests
  ...
2012-02-13 15:17:30 +01:00
Chris Beams 0ae973f995 Merge branch '3.1.x'
Conflicts:
	spring-webmvc/src/main/java/org/springframework/web/servlet/support/DefaultFlashMapManager.java
	spring-webmvc/src/test/java/org/springframework/web/servlet/support/DefaultFlashMapManagerTests.java
2012-02-01 11:39:48 +01:00
Chris Beams 398cf997b3 Merge branch '3.1.x'
This is the first merge from 3.1.x => master after the Gradle build
system migration. Notice how files changed under the 3.1.x directory
structure (org.springframework.*) merge seamlessly into the new
directory structure (spring-*).

Certain files had changed under 3.1.x that have since been deleted with
the Gradle build migration, e.g. all pom.xml files had <license>
sections added. These files showed up as a conflict during the merge,
but the resolution is to simply re-remove them and commit as they are
no longer relevant under 3.2.x / master.

Also noteworthy is the .gitignore file. It has been updated under 3.1.x
to ignore files and directories specific to the new Gradle-based
structure. However, this causes conflicts when trying to merge against
master, given that master should *not* ignore this directories. The
resolution in this situation is to simply force the 'master' version of
the file, i.e. when prompted for merge resolution:

    anakata:~/Work/spring-framework/spring-framework[master|MERGING]
    $ git status -sb
    ## master...springsource/master [ahead 24]
    UU .gitignore

    anakata:~/Work/spring-framework/spring-framework[master|MERGING]
    $ git checkout master .gitignore

    anakata:~/Work/spring-framework/spring-framework[master|MERGING]
    $ git commit

It is helpful in situations like this one to enable git's "rerere"
feature beforehand, which records and remembers resolution strategies,
avoiding the need to repeat them in future merges:

    $ git config --global rerere.enabled 1

See:
    http://progit.org/2010/03/08/rerere.html
    http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time

Conflicts:
    .gitignore
    .springframework.*/pom.xml
2012-01-31 16:03:24 +01:00
Chris Beams 366f0d7892 Generate -sources and -javadoc jars
Each spring-* subproject now has sourcesJar and javadocJar tasks

 - Ignore subproject overview.html files for now (not all have one)
 - Ensure @author attribution occurs
 - Javadoc 'header' is project description

spring-asm is a special case

 - source jar is created, but empty (to comply with entry rules for
   Maven Central)

 - add package-info.java explaining the nature of spring-asm
   this is nice, because it shows up in the public API docs now.

 - add SpringAsmInfo in the org.springframework.asm package as a
   placeholder allowing the generation of javadocs (see link to bug)

 - add explicit 'repackageAsm' Gradle task allowing for easy testing
   and merging of jar containing bundlor manifest as well as jar
   containing repackaged ASM classes.
2012-01-31 14:32:16 +01:00
Chris Beams 2bab8f3c0b Generate -docs, -schema and -dist zips
- Add 'api' gradle task to generate project-wide API Javadoc

   results in <root>/build/api

 - Add docsZip task including api and reference documentation

   suitable for publication to
   http://static.springframework.org/docs/spring-framework

 - Add schemaZip task including all spring-* XSD files

   suitable for publication to http://static.springframework.org/schema

 - Add distZip task to include all libs, docs and schema

   - filter src/dist/*.txt for ${copyright} and ${version}
   - copy legal (notice, license) dynamically into individual jar files
   - copy legal and readme files into root of distribution zip

 - Refactor location of 'wrapper' task

Each of the zip tasks (docsZip, schemaZip, distZip) have been added to
the 'archives' configuration, meaning that (a) they will be built
automatically with `gradle build` and (b) will be published
automatically to artifactory when using the Artifactory Gradle plugin
and/or Artifactory Bamboo integration.
2012-01-31 14:32:16 +01:00
Chris Beams 2ca6d0b2be Centralize license, notice, etc in src/dist
Prior to this change, license.txt and notice.txt files were duplicated
across every subproject in their respective src/main/resources/META-INF
directories.

This commit centralizes these files under the root project at src/dist,
along with the changelog and readme files. The definition of the 'jar'
task has been been extended to include the license and notice files in
module jars as they are created.

The directory is named src/dist because these files are all related to
distribution - the readme is different than the one you see at the root
of the source tree - the intended audience is for users who download
the spring-framework distribution zip. A task to create that
distribution zip will be added in subsequent commits.
2012-01-31 14:32:15 +01:00
Chris Beams 86b5066a96 Fix minor problems and polish reference docs
Problems

 - Eliminate &mdash; in favor of &#151;

   &mdash; was causing 'no such entity' errors during docbook
   processing; &#151; produces the equivalent output.

 - Fix column issues in appendices

   column counts were set to 3, when they are in fact 4. This passed
   under DocBook 4 and Spring Build for unknown reasons, but caused a
   hard stop under DocBook 5 and the docbook-reference-plugin.

 - Add jdbc callout section in docbook 5-friendly style

   use <co/> tags as advertised in DocBook documentation.

 - Set correct widths for PDF ref doc images

   images were rendering larger than the PDF page; just set all to
   width=400 and everything looks good.

Polish

 - Update reference doc copyright to 2012

 - Remove "work-in-progress" language from ref docs

 - Update maven URLs to repo.springsource.org

 - Update javadoc urls from 3.0.x/javadoc-api => current/api

 - Replace hardcoded "3.1" with ${version} in ref doc
2012-01-31 14:32:15 +01:00
Chris Beams 7a3aa70565 Remove <emphasis> to work around DocBook bug
It was determined (through painful trial and error) that after the
upgrade to DocBook 5 and the gradle-docbook-reference plugin, that
<emphasis> elements embedded within <programlisting> elements causes
NullPointerExceptions during processing.

This change eliminates these <emphasis> elements to work around the
problem. This means a slight degradation in presentation for the
affected areas of the reference documentation. After some research,
it is not clear what other workarounds may be possible that leave
the text actually emphasized.
2012-01-31 14:32:15 +01:00
Chris Beams 3641337186 Upgrade reference docs to DocBook 5
For compatibility with Gradle docbook-reference-plugin, which cannot
handle DocBook 4.
2012-01-31 14:32:15 +01:00
Chris Beams 62e94461f4 Move reference docs => src/reference
This change eliminates the spring-framework-reference subproject, moving
these sources into the root project's own src directory.

This makes sense because the reference docs span all submodules, and
also because api Javadoc is created at the root project level as well.
This means that both api and reference documentation output will now
reside in the root project's 'build' directory. This is more consistent
and easy to discover.
2012-01-31 14:32:14 +01:00
Chris Beams 0a07a0ed92 Move integration tests => src/test
This commit eliminates the 'integration-tests' subproject in favor of
managing these sources under the root project's own 'src' directory.

This helps to avoid special-case handling for integration-tests in the
Gradle build, e.g. avoiding publication of jars to Artifactory /
Maven Central.

It is also semantically more correct. This is not a Spring Framework
subproject so much as it is a collection of integration tests that
span functionality across many subprojects. In this way, it makes
sense to place them directly under the root project.

Issue: SPR-8116
2012-01-31 14:32:14 +01:00
Chris Beams 9fce69849a Move misplaced integration test to proper location 2011-08-15 21:44:18 +00:00
Chris Beams f480333d31 Merge 3.1.0 development branch into trunk
Branch in question is 'env' branch from git://git.springsource.org/sandbox/cbeams.git; merged into
git-svn repository with:

    git merge -s recursive -Xtheirs --no-commit env

No merge conflicts, but did need to

    git rm spring-build

prior to committing.

With this change, Spring 3.1.0 development is now happening on SVN
trunk. Further commits to the 3.0.x line will happen in an as-yet
uncreated SVN branch.  3.1.0 snapshots will be available
per the usual nightly CI build from trunk.
2010-10-25 19:48:20 +00:00