Commit Graph

726 Commits

Author SHA1 Message Date
Rossen Stoyanchev c9acaaf9d8 SPR-8823 ServletUriComponentsBuilder polish and reference doc update. 2011-11-08 17:49:38 +00:00
Rossen Stoyanchev bef75aab07 Polish synchronization of model attributes with the session. 2011-11-04 22:14:13 +00:00
Rossen Stoyanchev 8889284517 SPR-8801 Set ignoreDefaultModelOnRedirect=false in MVC namespace and Java config. 2011-11-04 03:02:47 +00:00
Rossen Stoyanchev cd2fee035a SPR-8783 Update javadoc of MVC's AnnotationDrivenBeanDefinitionParser 2011-11-03 19:19:54 +00:00
Rossen Stoyanchev bba8bb6ec0 SPR-8661 Add disabled attribute to HiddenInputTag 2011-11-03 16:29:12 +00:00
Rossen Stoyanchev c290a4e68a SPR-8694 HTML5 updates to the "type" attribute of the Spring Form tags.
Since dynamic attributes were allowed in Spring 3, it raised the 
possibility to specify a type attribute on a number of the form tags.
Where it makes sense (see below) that attribute is now rejected
and reversely where it makes sense it is accepted.

InputTag allows types other than "text" but rejects type="radio" or 
type="checkbox" since there is a good reason for those to be used 
only in conjunction with the appropriate form library tags.

Other HTML input tags such as PasswordTag, HiddenInputTag, 
Checkbox(es)Tag and RadioBox(es)Tag check the dynamic attributes 
and reject them if they contain a type attribute since.
2011-11-02 21:38:50 +00:00
Rossen Stoyanchev 8337f4bf20 SPR-8789 Support request with multiple param values in FlahMap matching logic 2011-11-01 16:26:25 +00:00
Rossen Stoyanchev e6920a59fa SPR-8779 Use original URI in FlashMap match logic to account for URL rewriting. 2011-11-01 15:19:04 +00:00
Rossen Stoyanchev 1164f5a9fc SPR-8782 Raise helpful error when RedirectAttributes is used with old infrastructure classes. 2011-11-01 11:46:09 +00:00
Rossen Stoyanchev 5a6980b78b SPR-7943 Minor fix 2011-10-22 13:07:36 +00:00
Rossen Stoyanchev 57fe16e14b SPR-8755 Add Button tag. 2011-10-21 23:36:41 +00:00
Rossen Stoyanchev fd97c8d7a4 SPR-8770 Ensure RequestDataValueProcessor is invoked from RedirectView. 2011-10-21 22:16:08 +00:00
Rossen Stoyanchev 3c649a6c66 Polish @EnableWebMvc javadoc 2011-10-17 22:59:54 +00:00
Rossen Stoyanchev 313ba395af Minor fix to name of attribute used to store FlashMap instances. 2011-10-17 21:30:09 +00:00
Rossen Stoyanchev 5d42a6242f SPR-8759 Provide methods to add or get status codes in SimpleMappingExceptionResolver as Map<String, Integer>. 2011-10-17 21:28:56 +00:00
Rossen Stoyanchev 1aa1278e99 SPR-8725 Change modifier in WebMvcConfigurationSupport methods from package private to public.
Use of package private @Bean methods can cause issues if the class
is extended and the sub-class is in a different package. This is 
covered in detail in SPR-8756.
2011-10-11 10:43:08 +00:00
Rossen Stoyanchev facb40e5a6 SPR-7943 Add test case for inserting extra hidden fields 2011-10-06 21:19:54 +00:00
Rossen Stoyanchev 369f6f032b SPR-7943 Minor fix 2011-10-06 14:17:44 +00:00
Rossen Stoyanchev b08c7f6e00 SPR-6801 @ModelAttribute instantiation refinement.
Instantiate the model attribute from a URI var or a request param only
if the name matches and there is a registered Converter<String, ?>.
2011-09-27 22:48:12 +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
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 c257afa515 SPR-7943 Add interface for HDIV integration and delegate to it from JSP form tags. 2011-09-19 21:32:45 +00:00
Rossen Stoyanchev b2d88ba858 SPR-6464 Polish following code review. 2011-09-15 18:12:30 +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 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
Chris Beams bc57f72bbb Temporarily @Ignore failure in RequestContextTests
Issue: SPR-5973
2011-09-13 18:53:18 +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
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
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 6b7e7d9b5c SPR-5973: UriBuilder 2011-09-07 09:07:09 +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
Rossen Stoyanchev 91251812b1 Polish @ExceptionHandler method resolution. Allow subclasses to plug in additional @ExceptionHandler methods. 2011-09-02 11:04:23 +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
Rossen Stoyanchev 37d22ad039 SPR-8611 Add detection of RedirectView when selecting the best view in ContentNegotiatingViewResolver. 2011-08-31 14:51:24 +00:00
Arjen Poutsma 4a669d1a0a Removed UrlPathHelper, as it's provided by the superclass 2011-08-31 08:42:45 +00:00
Sam Brannen 1de71c6e37 [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
Rossen Stoyanchev 6a06a17c47 SPR-6464 Add target request matching logic to DefaultFlashMapManager. 2011-08-29 08:37:43 +00:00
Rossen Stoyanchev 0460a5eceb SPR-8536 Add exact matches when comparing 'produces' conditions (e.g. given Accept: text/*, method with text/* is preferred over text/plain). Also pick a media type alphabetically when two 'produces' condition media types match equally (e.g. given Accept: text/* method with text/plain is chosen over text/xhtml) 2011-08-25 13:09:14 +00:00
Rossen Stoyanchev baea01ac90 SPR-6464 Add RedirectAttributes and SmartView interfaces. 2011-08-25 07:50:07 +00:00
Chris Beams 7d177ecfd4 Update Servlet 3.0 dependency in webmvc pom 2011-08-24 19:05:45 +00:00