1. 03 4月, 2015 1 次提交
  2. 02 4月, 2015 8 次提交
    • 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
    • S
      Support Jackson @JsonFilter · ca06582f
      Sebastien Deleuze 提交于
      This commit adds a filters property to MappingJacksonValue
      and also manages a special FilterProvider class name model key in
      order to be able to specify a customized FilterProvider for each
      handler method execution, and thus provides a more dynamic
      alternative to our existing JsonView support.
      
      A filters property is also now available in Jackson2ObjectMapperBuilder
      and Jackson2ObjectMapperFactoryBean in order to set easily a
      global FilterProvider.
      
      More details about @JsonFilter at
      http://wiki.fasterxml.com/JacksonFeatureJsonFilter.
      
      Issue: SPR-12586
      ca06582f
    • S
      Merge pull request #766 from izeye/patch-1 · 797159ce
      Stephane Nicoll 提交于
      * patch-1:
        Fix typo.
      797159ce
    • I
      Fix typo. · 593aff99
      izeye 提交于
      593aff99
    • R
      Fix compile error · 7e799295
      Rossen Stoyanchev 提交于
      7e799295
    • R
      Add RequestBodyAdviceAdapter · b5b0fd5e
      Rossen Stoyanchev 提交于
      Issue: SPR-12501
      b5b0fd5e
    • J
      e1395a6c
  3. 01 4月, 2015 8 次提交
  4. 31 3月, 2015 13 次提交
  5. 30 3月, 2015 7 次提交
    • S
      Polish Javadoc for ClassUtils · 502fa179
      Sam Brannen 提交于
      502fa179
    • S
    • S
      Refactor ObjectToObjectConverter & improve exception msg · bddc4373
      Sam Brannen 提交于
      - The exception message now mentions lacking to-Object method as well.
      
      - Documented explicit lacking support for toString() for conversions.
      
      - Introduced dedicated has*() methods for greater clarity and to reduce
        code duplication.
      
      - Static factory methods (i.e., of, from, valueOf) are now supported for
        conversion to a String.
      bddc4373
    • S
      Polish Javadoc for converters · db96113b
      Sam Brannen 提交于
      db96113b
    • S
      Polish ConversionService tests · 72d7963b
      Sam Brannen 提交于
      - Now correctly using @test(expected=...) where appropriate.
      
      - Renamed DefaultConversionTests to DefaultConversionServiceTests.
      
      - Moved all tests related to DefaultConversionService from
        GenericConversionServiceTests to DefaultConversionServiceTests.
      
      - No longer printing to System.out.
      
      - Removed all duplicate instantiation of conversion services.
      
      - Now using Java 8 streams to simplify implementations of custom test
        converters. Also using streams in tests where appropriate.
      72d7963b
    • R
      Improve empty request body handling · 36ed4df5
      Rossen Stoyanchev 提交于
      The check for an empty request body InputStream is now in the base
      class AbstractMessageConverterMethodArgumentResolver shared for
      all arguments that involve reading with an HttpMessageConverter --
      @RequestBody, @RequestPart, and HttpEntity.
      
      When an empty body is detected any configured RequestBodyAdvice is
      given a chance to select a default value or leave it as null.
      
      Issue: SPR-12778, SPR-12860, SPR-12861
      36ed4df5
    • R
      Add RequestBodyAdvice · 0556ed4f
      Rossen Stoyanchev 提交于
      RequestBodyAdvice is analogous to ResponseBodyAdvice (added in 4.1)
      but for intercepting for reading the request with an
      HttpMessageConverter for resolving an @RequestBody or an HttpEntity
      method argument.
      
      Issue: SPR-12501
      0556ed4f
  6. 28 3月, 2015 1 次提交
    • S
      Fix test · 073c1764
      Stephane Nicoll 提交于
      The rework of 314b069f in a7fec6a4 has created a lazy proxy to make sure
      that the need for an exception cache resolver come as late as possible.
      
      Unfortunately, the test that was only failing on CI because of an early
      lookup has not been updated accordingly. This is now the case.
      
      Issue: SPR-12850
      073c1764
  7. 27 3月, 2015 2 次提交