Commit Graph

5006 Commits

Author SHA1 Message Date
Rossen Stoyanchev 6bc4ea058c POLISH ARGUMENT RESOLVERS AND RETURN VALUE HANDLERS. 2011-09-24 11:34:07 +00:00
Rossen Stoyanchev fe7e2a7f54 Improvements to the way the content of RequestConditions is exposed.
RequestCondition types keep individual expression types (e.g. the
discrete header or param expressions) package private. Although the 
implementation of these types should remain private, there is no 
reason not to provide access to the underlying expression data --
e.g. for creating a REST endpoint documentation tool, or if you 
want to know which of the "consumes"/"produces" media types
are negated.

This change ensures that all RequestCondition types have a public
getter that makes available the basic expression data.
2011-09-23 18:20:27 +00:00
Rossen Stoyanchev fb526f534a SPR-8700 REFINE ORDER OF ARGUMENT RESOLUTION AND RETURN VALUE HANDLING.
1. Consider single-purpose return value types like HttpEntity, Model,
View, and ModelAndView ahead of annotations like @ResponseBody and
@ModelAttribute. And reversely consider multi-purpose return value 
types like Map, String, and void only after annotations like
@RB and @MA.

2. Order custom argument resolvers and return value handlers after the
built-in ones also clarifying the fact they cannot be used to override
the built-in ones in Javadoc throughout.

3. Provide hooks in RequestMappingHandlerAdapter that subclasses can use
to programmatically modify the list of argument resolvers and return
value handlers, also adding new getters so subclasses can get access
to what they need for the override.

4. Make SessionStatus available through ModelAndViewContainer and 
provide an argument resolver for it.

5. Init test and javadoc improvements.
2011-09-22 16:00:22 +00:00
Rossen Stoyanchev f200ccd899 SPR-8712 Expose BEST_MATCHING_PATTERN_ATTRIBUTE in RequestMappingHandlerMapping. 2011-09-20 10:09:52 +00:00
Rossen Stoyanchev 7a3f02bce9 SPR-8688 Don't use Servlet request params for form 'PUT' in ServletServerHttpRequest. 2011-09-20 09:18:47 +00:00
Rossen Stoyanchev c257afa515 SPR-7943 Add interface for HDIV integration and delegate to it from JSP form tags. 2011-09-19 21:32:45 +00:00
Sam Brannen 8b8be39d9f polishing 2011-09-17 11:59:46 +00:00
Rossen Stoyanchev 71cc38aaff SPR-6464 Update reference doc with FlashMap and RedirectAttributes information. 2011-09-16 16:44:11 +00:00
Rossen Stoyanchev b2d88ba858 SPR-6464 Polish following code review. 2011-09-15 18:12:30 +00:00
Arjen Poutsma aeba9d244a SPR-5973: now dealing with path followed by segments (and vice-versa) correctly. 2011-09-15 10:24:21 +00:00
Rossen Stoyanchev 1300da06a6 SPR-8593 Fix issue in ModelAndViewMethodReturnValueHandler with ModelAndView containing a View 2011-09-14 16:26:02 +00:00
Arjen Poutsma 38f05678c1 SPR-5973: UriComponents now encapsulates uri template variables 2011-09-14 14:36:49 +00:00
Arjen Poutsma 3f2ea7f50e SPR-5973: UriComponents now encapsulates a PathCompont, switching between string paths and path segment lists automatically. 2011-09-14 14:09:57 +00:00
Arjen Poutsma 782c2a4657 Removed ServletUriComponentsBuilder for now. 2011-09-14 14:01:50 +00:00
Arjen Poutsma 1b61f27f5b polishing 2011-09-14 14:01:21 +00:00
Chris Beams 10be0ef9e7 Clarify BeanFactory#containsBean Javadoc
Previously, #containsBean Javadoc advertised that a true return value
indicates that a call to #getBean for the same name would succeed.

This is actually not the case, and has never been.  The semantics
of #containsBean have always been to indicate whether a bean definition
with the given name is definied or a singleton instance with the given
name has been registered.

The Javadoc now reflects this accurately.

Issue: SPR-8690
2011-09-13 22:09:12 +00:00
Chris Beams bc57f72bbb Temporarily @Ignore failure in RequestContextTests
Issue: SPR-5973
2011-09-13 18:53:18 +00:00
Chris Beams 15a8f776b9 Clarify stereotype and exception translation Javadoc
Cite original inspiriation by Domain-Driven Design, but make clear the
flexible and general-purpose nature of Spring's stereotype annotations
such as @Repository and @Service.

Also update @Repository Javadoc with more explicit instructions about
switching on exception translation through use of
PersistenceExceptionTranslationPostProcessor, and update PETPP Javadoc
for style as well as concrete examples of 'resource factories' that
implement the PersistenceExceptionTranslator interface

Issue: SPR-8691
2011-09-13 17:53:15 +00:00
Keith Donald 1a2f96000e clarified repository definition from DDD and removed comparison with DAO to reduce confusion 2011-09-13 14:31:41 +00:00
Arjen Poutsma 663f056329 SPR-5973: UriComponents no longer a Map, moved all static methods from UriComponents to builder, added expand method to UriComponents 2011-09-13 14:12:54 +00:00
Arjen Poutsma dd1f3f8e0f Added MultiValueMap utility methods 2011-09-13 13:36:08 +00:00
Rossen Stoyanchev 28a696ba51 SPR-8676 Fix minor issue in how ServletServletHttpRequest detects form content-type requests 2011-09-13 12:35:05 +00:00
Rossen Stoyanchev de504fa613 SPR-8678 Use the lookup path to determine the media type by file name. 2011-09-13 09:16:42 +00:00
Rossen Stoyanchev 2799e710bc SPR-6464 Add 'setAlwaysUseRedirectAttributes' flag.
When set to 'true' the flag makes RedirectAttributes the only way to add 
attributes for a redirect thus ignoring the content of the default model 
even if RedirectAttributes is not in the list of controller method args.
2011-09-13 07:53:17 +00:00
Chris Beams a456a1a0e3 Improve annotation processing thread-safety
Commit http://bit.ly/nXumTs ensured that component methods and fields
marked with 'common annotations' such as @Resource, @PostConstruct and
@PreDestroy are invoked/assigned once and only once, even if multiple
instances of the CommonAnnotationBeanPostProcessor are processing the
same bean factory.

The implementation works against the InjectionMetadata API, adding and
removing these members from sets that track whether they are already
'externally managed', i.e. that another CABPP has already handled them,
thus avoiding redundant processing.

Prior to this change, the #remove operations against these sets were
not synchronized. In a single-threaded context this is fine thanks to
logic in AbstractAutowireCapableBeanFactory#doCreateBean that checks to
see whether a given bean definition has already been post processed.
However, as reported by SPR-8598, certain cases involving multiple
threads and annotated prototype-scoped beans can cause concurrent
modification exceptions during the #remove operation (ostensibly because
another thread is attempting to do the same removal at the same time,
though this has yet to be reproduced in isolation).

Now the sets originally introduced by the commit above are decorated
with Collections#synchronizedSet and any iterations over those sets
are synchronized properly. This change should have low performance
impact as such processing happens at container startup time (save for
non-singleton lookups at runtime), and there should be little
contention in any case.

Issue: SPR-8598
2011-09-12 23:05:01 +00:00
Arjen Poutsma c8add61a72 SPR-5973: Using UriComponents in more places, replaced UriBuilder by UriComponentsBuilder, UriComponents is now immutable. 2011-09-12 14:39:58 +00:00
Rossen Stoyanchev ce8bc8e7e4 SPR-6464 Add one more minor Javadoc comment 2011-09-09 17:05:47 +00:00
Rossen Stoyanchev 671744aa62 SPR-6464 Polish FlashMap changes. 2011-09-09 16:48:00 +00:00
Arjen Poutsma f0ed37c233 SPR-5973: UriUtils.parse returns UriComponents 2011-09-09 11:01:05 +00:00
Arjen Poutsma 65baafa032 SPR-5973: Made UriComponent enum inner type of UriComponents 2011-09-09 10:57:13 +00:00
Arjen Poutsma 6c58da0e55 SPR-5973: Added UriComponents type 2011-09-09 10:49:10 +00:00
Rossen Stoyanchev 56c8c69c4c SPR-8642 IMPROVE ERROR REPORTING WHEN RESOLVING MULTIPART REQUEST METHOD ARGUMENTS
Separate client from server errors as much as possible in this order:
- raise MultipartException when resolving a multipart arg and the 
  request is not a multipart request (400)
- raise IllegalArgumentException when the arg type is MultipartFile 
  but the request is not of type MultipartHttpServletRequest (500)
- raise MissingServletRequestPartException when a MultipartResolver
  is in use but the part is not found (400)
- detect presence of Servlet 3.0 before using standard multipart 
  parsing to find a request part or raise 
  IllegalArgumentException (500)

Unfortunately it is not always possible to separate client from 
server errors mainly because the Servlet 3.0 API does not 
distinguish between the case of 0 request parts vs multipart 
processing not being configured.
2011-09-09 09:09:10 +00:00
Arjen Poutsma b6c1e88e4a SPR-5973: Cleaning it up 2011-09-08 11:01:56 +00:00
Arjen Poutsma 5f208936ec Added parse methods 2011-09-07 13:58:51 +00:00
Arjen Poutsma 99f68d3620 SPR-5973: javadoc 2011-09-07 11:49:15 +00:00
Arjen Poutsma 420d11911b SPR-5973: Extract UriComponentTemplate out of UriTemplate 2011-09-07 11:26:22 +00:00
Arjen Poutsma 1d75e1b250 SPR-5973: Changed UriComponent from inner type to top-level enum 2011-09-07 10:40:40 +00:00
Arjen Poutsma 6b7e7d9b5c SPR-5973: UriBuilder 2011-09-07 09:07:09 +00:00
Arjen Poutsma f1c68f243e Changed ClientHttpRequestInterceptor array to List 2011-09-07 08:39:58 +00:00
Chris Beams 49b38190ee Fix typo in cache abstraction reference doc
Issue: SPR-8670
2011-09-06 21:03:02 +00:00
Arjen Poutsma 9a25efbbda SPR-5973: UriBuilder 2011-09-06 15:42:33 +00:00
Rossen Stoyanchev 498d81f696 SPR-8646 Encode URI template variables in the target URL of RedirectView. 2011-09-05 15:05:18 +00:00
Chris Beams 8759b20e46 Include javax.jdo 3.x in spring-orm template.mf
Prior to this change, spring-orm/template.mf was exclusive of javax.jdo
3.0.0. Now, after local testing against the newly-released jdo-api 3.0
jar, the template has been updated to allow for use in OSGi containers.
Note that actually updating build dependency descriptors to JDO 3.0 such
that the framework is continually tested against this version is covered
by a separate issue (SPR-8668).

Issue: SPR-8667, SPR-8655
2011-09-04 01:06:35 +00:00
Chris Beams 2e5f3559d3 Fix handling of @EnableLoadTimeWeaving AUTODETECT
Issue: SPR-8643
2011-09-03 22:37:16 +00:00
Chris Beams 4e522c0cc3 Fix Javadoc error in JdbcOperations
Issue: SPR-8664
2011-09-03 20:07:08 +00:00
Costin Leau d9de19d7b3 SPR-8653
+ refactor a bit the internals of CacheAspect to allow invocations that do not throw any exceptions (AspectJ)
2011-09-02 15:37:42 +00:00
Rossen Stoyanchev 91251812b1 Polish @ExceptionHandler method resolution. Allow subclasses to plug in additional @ExceptionHandler methods. 2011-09-02 11:04:23 +00:00
Costin Leau 04bcd77520 + temporarily revert change 2011-09-02 08:25:39 +00:00
Rossen Stoyanchev b6d7c85f6e SPR-7812 Provide separate methods for type and method-level custom request conditions. Polish javadoc in RequestMappingInfo and related HandlerMapping classes 2011-09-01 12:02:19 +00:00
Costin Leau ddfb2d3c58 + remove unneeded catch for exceptions inside AbstractCacheAspect.aj 2011-09-01 08:04:16 +00:00