Commit Graph

753 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 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
Chris Beams 1b176db8e7 Remove obsolete taglibs dependency from webmvc pom 2011-08-20 03:01:57 +00:00
Sam Brannen 87dad65ff0 [SPR-8622] Upgraded to JUnit 4.8.2 2011-08-18 16:06:31 +00:00
Rossen Stoyanchev 152add37d5 SPR-6464 Add getInputFlashMap and getOutputFlashMap methods to RequestContextUtils 2011-08-15 21:01:52 +00:00
Rossen Stoyanchev aa46d18125 SPR-6464 FlashMap polish 2011-08-15 12:48:33 +00:00
Rossen Stoyanchev 224bce1b64 SPR-8612 Allow explicit status code in HTTP 1.0 compatibility mode 2011-08-15 12:25:28 +00:00
Rossen Stoyanchev 936c83b030 SPR-6464 Add RedirectModel 2011-08-14 22:32:42 +00:00
Rossen Stoyanchev 45efe6184c SPR-6464 FlashMap polish 2011-08-12 18:32:30 +00:00
Rossen Stoyanchev c97257b16f SPR-6464 Fix minor issue 2011-08-11 10:25:16 +00:00
Rossen Stoyanchev 6f1818a604 SPR-6464 Use the redirect URL and its request parameters (if any), instead of a synthetic key, to match a FlashMap instance to its intended recepient request. This should help to prevent conflicts in most cases transparently. Only if necessary a controller can add extra request parameters to distinguish the request even more uniquely. 2011-08-10 16:53:03 +00:00
Rossen Stoyanchev 1df0cd9f20 SPR-6464 Drop @FlashAttributes, add ResponseContext, ViewResponse, and RedirectResponse types for annotated controllers to use to prepare a redirect response with flash attributes; Add FlashMap and FlashMapManager and update DispatcherServlet to discover and invoke the FlashMapManager. 2011-08-08 14:00:07 +00:00
Rossen Stoyanchev fc4ea16ba0 Replace RequestBodyNotValidException and RequestPartNotValidException with MethodArgumentNotValidException and add MethodParameter information to the exception message. 2011-08-03 15:10:10 +00:00
Rossen Stoyanchev 3c7e44ada4 SPR-8536 When two methods match a request for any content type (i.e. Accept=*/* or no Accept header), choose the one that doesn't define any 'Accept' media types by default. This addresses an important use case where methods serving browsers typically don't specify Accept media types. 2011-08-03 11:22:46 +00:00
Juergen Hoeller 8745024969 added getContentAsByteArray() and getContentAsString() methods (SPR-8575); actually implemented forward, include and handlePageException methods 2011-08-02 23:52:54 +00:00
Juergen Hoeller df1f3d40bd polishing 2011-08-02 19:16:50 +00:00
Juergen Hoeller 0a48936f4f ContentNegotiatingViewResolver properly handles invalid accept headers (SPR-7712) 2011-08-02 19:13:56 +00:00
Rossen Stoyanchev 3fb753bc0c SPR-8448 Use URI template vars rather than path vars in RedirectView 2011-08-02 08:27:26 +00:00
Rossen Stoyanchev 98ad8633bd SPR-8524 Add flag to AbstractCachingViewResolver to suppress subsequent resolution of unresolved view names. 2011-08-01 10:20:49 +00:00
Juergen Hoeller fad865fbad polishing 2011-07-27 22:38:59 +00:00
Juergen Hoeller 4385367f2d optimized getMethodResolver implementation to actually benefit from ConcurrentHashMap 2011-07-27 22:26:05 +00:00
Juergen Hoeller 19c2672dc3 polishing 2011-07-27 21:52:18 +00:00
Rossen Stoyanchev f4adf227be SPR-6464 Add @FlashAttributes annotation and FlashStatus method argument 2011-07-27 21:46:36 +00:00
Juergen Hoeller 2c504012ad HtmlUtils properly escapes single quotes as well 2011-07-27 21:22:04 +00:00
Rossen Stoyanchev 9347ac358c SPR-8540 Minor Freemarker import related documentation fix 2011-07-27 11:14:31 +00:00
Rossen Stoyanchev 38a6660777 SPR-8543 Fix issue in AnnotationMethodHandlerAdapter with extracting URI template variable from URL with file extension 2011-07-26 08:26:09 +00:00
Juergen Hoeller ff8ebbb9c4 moved OpenSessionInViewTests back to orm module 2011-07-26 01:07:59 +00:00
Juergen Hoeller 83df082930 moved OpenSessionInViewTests back to orm module 2011-07-26 00:46:07 +00:00
Juergen Hoeller d7cd11a48c consistent update of HeaderValueHolder class 2011-07-26 00:39:01 +00:00
Juergen Hoeller bbab294116 added Jetty dependency 2011-07-25 12:27:49 +00:00
Juergen Hoeller 2218cdb16f polishing 2011-07-25 10:57:50 +00:00
Rossen Stoyanchev fd7e0b405b SPR-8515 Check for traversal to parent directory via ../ in resource requests 2011-07-22 16:27:33 +00:00
Rossen Stoyanchev 3363d05879 SPR-8483 Add integration test for accessing multipart request parts with @RequestPart 2011-07-21 16:24:33 +00:00
Juergen Hoeller 2d7af57149 fixed DispatcherServletTests breakage 2011-07-20 21:04:29 +00:00
Juergen Hoeller 571535352b revised Servlet 3.0 based StandardServletMultipartResolver for correct param/file distinction; added multipart content type and headers access to MultipartRequest (dropping the previous header access solution on MultipartFile); MultipartFilter uses a Servlet 3.0 based StandardServletMultipartResolver by default 2011-07-20 20:46:53 +00:00
Rossen Stoyanchev e787887f46 SPR-8532 Exclude Tiles transitive deps on 'com.springsource.javax.servlet' from 'com.springsource.org.apache.tiles.jsp' and 'com.springsource.org.apache.tiles.servlet' only. 2011-07-19 11:04:27 +00:00
Juergen Hoeller 7e4982d6ae updated dependencies 2011-07-18 21:41:21 +00:00
Rossen Stoyanchev 2568a3c2c6 SPR-8001 Recognize case when MultipartRequest is null and argument is of type MultipartFile and raise helpful exception. 2011-07-18 13:49:47 +00:00
Rossen Stoyanchev b8c723d080 SPR-8532 Upgrade org.springframework.web.servlet to Servlet 3.0 (as provided dependency) and add support for javax.servlet.Part parameter 2011-07-18 12:06:11 +00:00
Juergen Hoeller 6cd55b7986 ContextLoader and FrameworkServlet support "contextId" parameter for custom serialization id 2011-07-03 22:36:42 +00:00
Sam Brannen e94d1e314f fixed typo and formatting in Javadoc 2011-07-01 17:33:13 +00:00
Rossen Stoyanchev e0d2e20fc4 8483 Add support for MultipartFile arg type in RequestPartMethodArgumentResolver 2011-06-30 21:04:23 +00:00
Rossen Stoyanchev a58bd3073d SPR-8431 Extract RedirectView URL creation into separate method available for subclasses to use 2011-06-30 09:13:51 +00:00
Rossen Stoyanchev 0dae1a6bd8 SPR-8447 Provide sufficient contextwherever possible when exceptions are raised in new @MVC classes. 2011-06-29 15:36:18 +00:00
Rossen Stoyanchev 3a87d8e7cb SPR-8483 Add support for @RequestPart annotated method parameters 2011-06-28 19:22:33 +00:00
Juergen Hoeller 3bbefb3e65 fixed getHeaderNames signature 2011-06-28 14:08:47 +00:00
Juergen Hoeller 0371f569ec added headers support to MultipartFile abstraction 2011-06-27 23:02:13 +00:00
Rossen Stoyanchev 78470782d4 SPR-8487 Ensure setters for argument resolvers and return value handlers replace the defaults completely. 2011-06-27 22:23:10 +00:00
Rossen Stoyanchev 1e07af8827 SPR-7608 Add fallback mechanism for instantiating a model attribute from a path variable 2011-06-24 17:18:53 +00:00
Rossen Stoyanchev 8e240d814b SPR-6909 Improve extension hooks in DefaultDataBinderFactory and subclasses. 2011-06-24 12:04:16 +00:00
Rossen Stoyanchev 2122cbcb1b SPR-8484 Add path variables to the model via AbstractView.render(..) rather than HandlerMethodArgumentResolver 2011-06-24 10:09:28 +00:00
Rossen Stoyanchev df5e4d6d56 SPR-7746 Add examples of using regex in URI template vars and working with 'Last-Modified' HTTP requests 2011-06-23 15:28:57 +00:00
Rossen Stoyanchev 465712c845 Add boolean flag in RequestMappingHandlerMapping to indicate if type- or method-level @RequestMapping annotation is being introspected 2011-06-22 22:29:26 +00:00
Rossen Stoyanchev 54c82a53cd SPR-8452 Provide getter for statusCodes property of SimpleMappingExceptionResolver 2011-06-22 19:29:35 +00:00
Rossen Stoyanchev 5797fe7f62 SPR-7210 Add setModelKey and setModelKeys to MappingJacksonJsonView for consistency with MarshallingView. 2011-06-22 19:08:44 +00:00
Rossen Stoyanchev 564f0ec3c3 SPR-8444 Added MapAccessor and EnvironmentAccessor to EL context in the eval tag 2011-06-21 16:50:00 +00:00
Rossen Stoyanchev 5f76ad809f SPR-8429 Return 400 instead of 500 for required header/cookie/pathvar. This is also more in line with jax-rs. 2011-06-21 15:03:12 +00:00
Rossen Stoyanchev 8292491a53 SPR-6164 Add option to disable '.*' pattern matching in RequestMappingHandlerMapping and PatternsRequestCondition 2011-06-21 11:29:44 +00:00
Rossen Stoyanchev a7ff8a2efa SPR-8464 Fix problem in test with date formatting 2011-06-20 20:51:26 +00:00
Rossen Stoyanchev 40fb1b21e1 SPR-8464 Fix bug with detecting annotations on handler method arguments and consolidate anotation detection tests. 2011-06-20 19:32:27 +00:00
Rossen Stoyanchev c41caa3c2f SPR-8462 2011-06-20 11:46:43 +00:00
Rossen Stoyanchev 6007801537 SPR-7812 Add CustomRequestCondition, PatternsRequestCondition, and other condition related tests 2011-06-19 22:52:52 +00:00
Rossen Stoyanchev aacdd36e04 SPR-7812 Move condition package under mvc 2011-06-17 23:26:21 +00:00
Rossen Stoyanchev 4826cae064 SPR-7812 Add CustomRequestCondition 2011-06-17 23:19:14 +00:00
Rossen Stoyanchev e5eceafa3f SPR-7278 extension hook to extend the @ExceptionHandler methods for a controller 2011-06-17 13:14:34 +00:00
Rossen Stoyanchev 96b0752ddb SPR-7812 RequestCondition refactoring with the possibility for custom request conditions in mind. 2011-06-17 09:39:49 +00:00
Rossen Stoyanchev 23f31d453f SPR-8448 Remove URI template vars from the model before appending to query string in RedirectView 2011-06-15 21:07:37 +00:00
Rossen Stoyanchev ab033086f9 SPR-8454 Introduce Registration style objects, rename several Spring MVC *Configurer helpers to *Registry, add more tests 2011-06-15 08:06:42 +00:00
Juergen Hoeller cb1ddb334b consistent dependency on Hibernate Validator 4.1.0.GA 2011-06-14 21:39:17 +00:00
Rossen Stoyanchev fa0b683161 Extract base class from RequestMappingHandlerMapping, one that allows for discovering request mappings from something other than annotations 2011-06-14 09:20:07 +00:00
Juergen Hoeller 6c3cc786d0 added further conversion tests (triggered by 3.0.6 backports) 2011-06-13 23:43:46 +00:00
Rossen Stoyanchev 883ac319bc SPR-8430 Rename WebMvcConfiguration to DelegatingWebMvcConfiguration, make it public and make delegation methods final 2011-06-13 12:20:25 +00:00
Chris Beams 9b45d50b9b Add missing isDebugEnabled guard in FrameworkServlet
Issue: SPR-8085
2011-06-13 08:31:15 +00:00
Chris Beams 2d68b726b5 Add syntax highlighting to Javadoc where necessary
Issue: SPR-8426
2011-06-12 06:56:17 +00:00
Rossen Stoyanchev fdeeeac5d0 SPR-8430 2011-06-09 15:12:02 +00:00