1. 17 4月, 2015 1 次提交
  2. 16 4月, 2015 4 次提交
  3. 15 4月, 2015 9 次提交
  4. 14 4月, 2015 8 次提交
  5. 10 4月, 2015 2 次提交
  6. 09 4月, 2015 1 次提交
    • S
      Support static fields in ReflectionTestUtils · 063ef240
      Sam Brannen 提交于
      Prior to this commit it was possible to set or get a static field using
      ReflectionTestUtils but only if an instance of the target class was
      available.
      
      This commit introduces dedicated support for setting and getting static
      fields in ReflectionTestUtils when only the target class is available.
      
      Furthermore, this commit increases the robustness of
      ReflectionTestUtilsTests regarding expected exceptions and simplifies
      the Javadoc for ReflectionTestUtils.
      
      Issue: SPR-6792
      063ef240
  7. 08 4月, 2015 2 次提交
  8. 07 4月, 2015 7 次提交
  9. 04 4月, 2015 3 次提交
  10. 03 4月, 2015 1 次提交
  11. 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