Commit Graph

749 Commits

Author SHA1 Message Date
Rossen Stoyanchev 6f150e4f07 SPR-8898 Allow match by trailing slash in RequestMappingHandlerMapping. 2011-12-08 03:38:50 +00:00
Juergen Hoeller 83c83d4d15 fixed media type resolution algorithm 2011-12-06 23:53:22 +00:00
Juergen Hoeller 34a4fba335 ResourceHttpRequestHandler sends content without content-type header if no media type found (SPR-7713); ResourceHttpRequestHandler and ContentNegotiatingViewResolver use consistent mime type resolution 2011-12-06 22:54:47 +00:00
Juergen Hoeller bea5016e53 fixed validation test failures 2011-12-03 17:03:33 +00:00
Juergen Hoeller 49a2aaf023 added SmartValidator interface with general support for validation hints; added custom @Valid annotation with support for JSR-303 validation groups; JSR-303 SpringValidatorAdapter and MVC data binding provide support for validation groups (SPR-6373) 2011-12-03 15:44:33 +00:00
Rossen Stoyanchev 9f98f77c3e SPR-8863 Add RequestContext.getPathToServlet() method.
This method allows a view to access the combined context path and
servlet mapping path for prefixing URLs without having to specify
the literal part of a servlet mapping such as "/main/*") 
explicitly everywhere. For example:

${requestContext.pathToServlet}/css/main.css
2011-12-01 22:56:51 +00:00
Juergen Hoeller 45a0ae3fb9 polishing 2011-12-01 15:11:32 +00:00
Rossen Stoyanchev ca4eafd4dd SPR-8808 Remove excludeFilter from javadoc examples in @EnableWebMvc. 2011-12-01 14:35:36 +00:00
Juergen Hoeller c2eafdb2fb AbstractCachingViewResolver caches unresolved view names by default ("cacheUnresolved"=true; SPR-8173) 2011-11-28 22:46:53 +00:00
Juergen Hoeller 1bb6d29be2 AbstractCachingViewResolver caches unresolved view names by default ("cacheUnresolved"=true; SPR-8173) 2011-11-28 22:34:29 +00:00
Juergen Hoeller 61a5ab9d34 fixed "formMultiSelect"/"formCheckboxes" FreeMarker macros to compare against actual field value (SPR-7721) 2011-11-28 14:42:03 +00:00
Rossen Stoyanchev ca3d774f5c Add detectHandlerMethodsInAncestorContexts property to AbstractHandlerMethodMapping. 2011-11-23 18:59:08 +00:00
Rossen Stoyanchev b5bcfa0ae3 SPR-8858 Fix in AntPathMatcher.combine(..)
Currently the combine method consolidates "/*" and "/hotel" 
into "/hotel". However if the first pattern contains URI template 
variables, the consolidation seems wrong. The fix is to prevent
the consolidation if the first pattern contains "{".
2011-11-23 17:53:18 +00:00
Rossen Stoyanchev e695a21688 SPR-8862 Fix issue with matching negated header values. 2011-11-23 15:23:55 +00:00
Rossen Stoyanchev 947b5fefff SPR-8851 Switch to logging debug messages in AbstractWebArgumentResolverAdapter 2011-11-18 16:18:55 +00:00
Rossen Stoyanchev 60ee0bb8f4 SPR-8020 Support UriComponentsBuilder as a controller method argument.
The UriComponentsBuilder instance passed into the method is initialized
with current request information including host, scheme, port, context
path, and the servlet mapping's literal part.

Also added shortcut methods to buildAndExpand in UriComponentsBuilder.
2011-11-18 14:36:44 +00:00
Rossen Stoyanchev e4fada56ab SPR-8859 Fix issue with prototype controllers in RequestMappingHandlerAdapter. 2011-11-18 11:32:01 +00:00
Rossen Stoyanchev 63e235f215 SPR-8750 Refine 'Content-Type' update in MockHttpServletRequest/Response.
The initial solution kept these three in full sync at all times:
contentType field, characterEncoding field, 'Content-Type' header.
That is correct behavior, however it breaks existing tests that rely
on contentType and characterEncoding being equal to exactly what 
they were set to.

For example, consider:
response.setContentType("text/plain");
response.setCharacterEncoding("UTF-8");

Ideally both contentType and the 'Content-Type' header would now be
"text/plain;charset=UTF-8". However, existing tests would expect 
that contentType is equal to "text/plain".

To avoid breaking existing tests, contentType and characterEncoding
will continue to be equal to exactly what they were set to while
the 'Content-Type' header will always include both the content 
type and the charset.

The only exception to this rule is when a 'Content-Type' header
is set explicitly, the contentType and characterEncoding fields will 
be updated accordingly, possibly overriding the existing values.
2011-11-17 15:07:15 +00:00
Rossen Stoyanchev 7918810366 SPR-8750 Update MockHttpServletRequest/Response handling of contentType.
The Content-Type header and the contentType field in HttpServletRequest/Response
are now always in sync. When a header is added the contentType field is updated
as well and vice versa. 

Similarly when the Content-Type header or the contentType field includes a charset 
field, the character encoding is updated and vice versa.
2011-11-16 23:28:48 +00:00
Chris Beams 70c28a0bc5 Add Apache license header where missing in src/main 2011-11-16 18:23:56 +00:00
Juergen Hoeller b21e1ee669 polishing 2011-11-11 09:57:34 +00:00
Rossen Stoyanchev c3f0f31243 SPR-8819 Fix issue in setting best matching pattern. 2011-11-08 20:00:42 +00:00
Rossen Stoyanchev b9a3d4577a SPR-8823 Fix test error. 2011-11-08 19:25:50 +00:00
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