Commit Graph

5020 Commits

Author SHA1 Message Date
Chris Beams 34956d30b3 Fix doc typo in AbstractAutowireCapableBeanFactory 2011-09-27 18:16:20 +00:00
Rossen Stoyanchev a33d277509 Add ExceptionHandlerExceptionResolver tests for custom arg resolvers 2011-09-27 11:22:58 +00:00
Rossen Stoyanchev 7fec9d7fa8 SPR-7943 Add one missing call to RequestDataValueProcessor in FormTag. 2011-09-27 11:22:48 +00:00
Rossen Stoyanchev 57fffb147c SPR-7608 ALLOW EXCEPTION WHEN MODEL ATTR IS CREATED FROM URI VARIABLE
When a @ModelAttribute is instantiated from a URI variable with type
conversion, if conversion fails allow the exception to propagate. 
This is consistent with what happens on type conversion failure with
@PathVariable and other args that rely on type conversion.
2011-09-27 11:22:43 +00:00
Arjen Poutsma 5afe139285 SPR-8706 - UriUrils.decode() not properly rejecting invalid escaped URLs 2011-09-27 08:55:07 +00:00
Arjen Poutsma 67fda70cb8 SPR-8713 - DefaultResponseErrorHandler IOException Bug 2011-09-27 08:16:33 +00:00
Sam Brannen aa7a100807 [SPR-8178] re-enabled testPrintNull(). 2011-09-26 18:59:11 +00:00
Rossen Stoyanchev 3d50d416eb SPR-8718 Revert fix from earlier for now (need a different approach). 2011-09-26 17:58:49 +00:00
Sam Brannen 5309e43ea0 [SPR-8178] @Ignore-ing testPrintNull() until it is determined why changes to GenericConversionService broke this test. 2011-09-26 17:39:04 +00:00
Sam Brannen 052d3e7ccb [SPR-8718] now using correct JIRA ID in the comments. 2011-09-26 16:28:34 +00:00
Sam Brannen f752b47fcb [SPR-8178] @Ignore-ing testDefaultNumberFormatting() until it is determined why changes to GenericConversionService broke this test. 2011-09-26 16:24:51 +00:00
Rossen Stoyanchev 1d7a6c53da SPR-8718 Prevent ClassCastException when the target of Converter<?,?> is a super-class of the actual target. 2011-09-26 12:30:38 +00:00
Sam Brannen f6483cad3c [SPR-8222] Suppressing deprecation warnings for org.junit.internal.runners.model.MultipleFailureException, which has been deprecated in JUnit 4.9. 2011-09-26 11:13:59 +00:00
Rossen Stoyanchev 48f7dcc464 POLISH CREATION OF DATA BINDERS FOR @RequestMapping METHODS
Make it possible to hook in custom ServletRequestDataBinderFactory
by overriding RequestMappingHandlerAdapter. 

Create ExtendedServletRequestDataBinder to add URI template vars
to the binding values taking advantage of a new extension hook in
ServletRequestDataBinder to provide additional values to bind.
2011-09-26 09:27:09 +00:00
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