1. 21 5月, 2015 2 次提交
    • S
      Merge BeanWrapperImpl and DirectFieldAccessor · 3d86f15a
      Stephane Nicoll 提交于
      `BeanWrapperImpl` and `DirectFieldAccessor` are two
      `ConfigurablePropertyAccessor` implementations with different features
      set.
      
      This commit harmonizes the two implementations to use a common base class
      that delegates the actual property handling to the sub-classes:
      
      * `BeanWrapperImpl`:  `PropertyDescriptor` and introspection utilities
      * `DirectFieldAccessor`: reflection on `java.lang.Field`
      
      Issues: SPR-12206 - SPR-12805
      3d86f15a
    • R
      Add baseUrl to DefaultUriTemplateHandler · 1ba0625c
      Rossen Stoyanchev 提交于
      Issue: SPR-13035
      1ba0625c
  2. 20 5月, 2015 1 次提交
  3. 19 5月, 2015 4 次提交
    • S
      polish · cf391f5c
      Stephane Nicoll 提交于
      Remove unused imports
      cf391f5c
    • R
      Polish · 6468aa77
      Rossen Stoyanchev 提交于
      Issue: SPR-12893
      6468aa77
    • L
      Support OkHttp as (Async)ClientHttpRequestFactory · 69fc2a8a
      Luciano Leggieri 提交于
      This commit introduces support for OkHttp
      (http://square.github.io/okhttp/) as a backing implementation for
      ClientHttpRequestFactory and AsyncClientHttpRequestFactory.
      
      Issue: SPR-12893
      69fc2a8a
    • R
      CORS-related refinements · 5e8d8383
      Rossen Stoyanchev 提交于
      After this change CorsProcessor has a single processRequest method and
      it also explicitly deals with a null CorsConfiguration, which for
      pre-flight requests results in a rejection while for simple requests
      results in no CORS headers added.
      
      The AbstractHandlerMapping now uses a LinkedHashMap to preserve the
      order in which global patterns are provided.
      5e8d8383
  4. 18 5月, 2015 2 次提交
  5. 16 5月, 2015 1 次提交
    • S
      Add global CORS configuration capabilities · 49fff751
      Sebastien Deleuze 提交于
      This commit adds JavaConfig based global CORS configuration
      capabilities to Spring MVC. It is now possible to specify
      multiple CORS configurations, each mapped on a path pattern,
      by overriding
      WebMvcConfigurerAdapter#configureCrossOrigin(CrossOriginConfigurer).
      
      It is also possible to combine global and @CrossOrigin based
      CORS configuration.
      
      Issue: SPR-12933
      49fff751
  6. 15 5月, 2015 2 次提交
    • R
      Add component-neutral encode option in UriUtils · ca410fea
      Rossen Stoyanchev 提交于
      Issue: SPR-12750, SPR-12942
      ca410fea
    • R
      Add UriTemplateHandler · 3e59c244
      Rossen Stoyanchev 提交于
      This change introduces a strategy for expanding a URI template into a
      URI and makes it a property of the RestTemplate and AsyncRestTemplate
      so that they can be pre-configured with such a strategy.
      
      The DefaultUriTemplateHandler relies on UriComponentsBuilder internally
      and provides functionality equivalent to using the UriTemplate.
      A DefaultUriTemplateHandler can also be configured to parse the path
      of a URI template into path segments in order to allow expanding URI
      variables according to path segment encoding rules.
      
      Issue: SPR-12750
      3e59c244
  7. 14 5月, 2015 1 次提交
  8. 12 5月, 2015 2 次提交
  9. 11 5月, 2015 1 次提交
  10. 10 5月, 2015 1 次提交
  11. 07 5月, 2015 2 次提交
  12. 06 5月, 2015 1 次提交
    • R
      Find CORS config by HandlerMethod · 8853107f
      Rossen Stoyanchev 提交于
      Before this change AbstractHandlerMethodMapping used a map from Method
      to CorsConfiguration. That works for regular @RequestMapping methods.
      However frameworks like Spring Boot and Spring Integration may
      programmatically register the same Method under multiple mappings,
      i.e. adapter/gateway type classes.
      
      This change ensures that CorsConfiguraiton is indexed by HandlerMethod
      so that we can store CorsConfiguration for different handler instances
      even when the method is the same.
      
      In order for to make this work, HandlerMethod now provides an
      additional field called resolvedFromHandlerMethod that returns the
      original HandlerMethod (with the String bean name). This makes it
      possible to  perform reliable lookups.
      
      Issue: SPR-11541
      8853107f
  13. 05 5月, 2015 3 次提交
    • S
      Consistently supply test name to @Parameters · 572cbb08
      Sam Brannen 提交于
      572cbb08
    • R
      Encapsulate CORS checking within CorsConfiguration · e3060981
      Rossen Stoyanchev 提交于
      CorsConfiguration now provides methods to check and determine the
      allowed origin, method, and headers according to its own configuration.
      
      This simplifies significantly the work that needs to be done from
      DefaultCorsProcessor. However an alternative CorsProcessor can still
      access the raw CorsConfiguration and perform its own checks.
      
      Issue: SPR-12885
      e3060981
    • S
      Make DefaultCorsProcessor Servlet 2.5 compliant · 83f269b5
      Sebastien Deleuze 提交于
      This commit adds CORS related headers to HttpHeaders
      and update DefaultCorsProcessor implementation to
      use ServerHttpRequest and ServerHttpResponse instead
      of HttpServletRequest and HttpServletResponse. Usage
      of ServerHttpResponse allows to avoid using Servlet 3.0
      specific methods in order keep CORS support Servlet 2.5
      compliant.
      
      Issue: SPR-12885
      83f269b5
  14. 04 5月, 2015 3 次提交
  15. 24 4月, 2015 1 次提交
  16. 20 4月, 2015 1 次提交
  17. 17 4月, 2015 1 次提交
  18. 15 4月, 2015 2 次提交
  19. 14 4月, 2015 2 次提交
    • R
      Fix failing test · b18053f9
      Rossen Stoyanchev 提交于
      The onFailure callback and future.get() occur in different threads so
      this change adds a latch to ensure we have both before asserting.
      
      Issue: SPR-12887
      b18053f9
    • R
      Try defaulContentType for application/octet-stream · 8ff7cc73
      Rossen Stoyanchev 提交于
      AbstractHttpMessageConverter now tries to call getDefaultContentType
      with the actual value to be converted to see if that will result in
      a more concrete mediat type than application/octet-stream.
      
      Issue: SPR-12894
      8ff7cc73
  20. 10 4月, 2015 1 次提交
  21. 07 4月, 2015 2 次提交
  22. 04 4月, 2015 1 次提交
  23. 03 4月, 2015 1 次提交
  24. 02 4月, 2015 2 次提交
    • S
      Add CORS support · b0e1e66b
      Sebastien Deleuze 提交于
      This commit introduces support for CORS in Spring Framework.
      
      Cross-origin resource sharing (CORS) is a mechanism that allows
      many resources (e.g. fonts, JavaScript, etc.) on a web page to
      be requested from another domain outside the domain from which
      the resource originated. It is defined by the CORS W3C
      recommandation (http://www.w3.org/TR/cors/).
      
      A new annotation @CrossOrigin allows to enable CORS support
      on Controller type or method level. By default all origins
      ("*") are allowed.
      
      @RestController
      public class SampleController {
      
      	@CrossOrigin
      	@RequestMapping("/foo")
      	public String foo() {
      		// ...
      	}
      }
      
      Various @CrossOrigin attributes allow to customize the CORS configuration.
      
      @RestController
      public class SampleController {
      
      	@CrossOrigin(origin = { "http://site1.com", "http://site2.com" },
      				 allowedHeaders = { "header1", "header2" },
      				 exposedHeaders = { "header1", "header2" },
      				 method = RequestMethod.DELETE,
      				 maxAge = 123, allowCredentials = "true")
      	@RequestMapping(value = "/foo", method = { RequestMethod.GET, RequestMethod.POST} )
      	public String foo() {
      		// ...
      	}
      }
      
      A CorsConfigurationSource interface can be implemented by HTTP request
      handlers that want to support CORS by providing a CorsConfiguration
      that will be detected at AbstractHandlerMapping level. See for
      example ResourceHttpRequestHandler that implements this interface.
      
      Global CORS configuration should be supported through ControllerAdvice
      (with type level @CrossOrigin annotated class or class implementing
      CorsConfigurationSource), or with XML namespace and JavaConfig
      configuration, but this is not implemented yet.
      
      Issue: SPR-9278
      b0e1e66b
    • S
      Add @JsonView deserialization support for request bodies · 35f40ae6
      Sebastien Deleuze 提交于
      Jackson 2.5.0 or later is required.
      
      Issue: SPR-12501
      35f40ae6