- 31 5月, 2015 5 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-11393
-
由 Sam Brannen 提交于
Issue: SPR-11393
-
由 Sam Brannen 提交于
Issue: SPR-11393
-
由 Sam Brannen 提交于
Issue: SPR-11393
-
由 Sam Brannen 提交于
Issue: SPR-11393
-
- 29 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
-
- 24 5月, 2015 2 次提交
-
-
由 Juergen Hoeller 提交于
-
由 Juergen Hoeller 提交于
-
- 23 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 22 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
This commit introduces first-class support for aliases for annotation attributes. Specifically, this commit introduces a new @AliasFor annotation that can be used to declare a pair of aliased attributes within a single annotation or an alias from an attribute in a custom composed annotation to an attribute in a meta-annotation. To support @AliasFor within annotation instances, AnnotationUtils has been overhauled to "synthesize" any annotations returned by "get" and "find" searches. A SynthesizedAnnotation is an annotation that is wrapped in a JDK dynamic proxy which provides run-time support for @AliasFor semantics. SynthesizedAnnotationInvocationHandler is the actual handler behind the proxy. In addition, the contract for @AliasFor is fully validated, and an AnnotationConfigurationException is thrown in case invalid configuration is detected. For example, @ContextConfiguration from the spring-test module is now declared as follows: public @interface ContextConfiguration { @AliasFor(attribute = "locations") String[] value() default {}; @AliasFor(attribute = "value") String[] locations() default {}; // ... } The following annotations and their related support classes have been modified to use @AliasFor. - @ManagedResource - @ContextConfiguration - @ActiveProfiles - @TestExecutionListeners - @TestPropertySource - @Sql - @ControllerAdvice - @RequestMapping Similarly, support for AnnotationAttributes has been reworked to support @AliasFor as well. This allows for fine-grained control over exactly which attributes are overridden within an annotation hierarchy. In fact, it is now possible to declare an alias for the 'value' attribute of a meta-annotation. For example, given the revised declaration of @ContextConfiguration above, one can now develop a composed annotation with a custom attribute override as follows. @ContextConfiguration public @interface MyTestConfig { @AliasFor( annotation = ContextConfiguration.class, attribute = "locations" ) String[] xmlFiles(); // ... } Consequently, the following are functionally equivalent. - @MyTestConfig(xmlFiles = "test.xml") - @ContextConfiguration("test.xml") - @ContextConfiguration(locations = "test.xml"). Issue: SPR-11512, SPR-11513
-
- 21 5月, 2015 1 次提交
-
-
由 Rossen Stoyanchev 提交于
Issue: SPR-13035
-
- 20 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12926
-
- 19 5月, 2015 2 次提交
-
-
由 Stephane Nicoll 提交于
Remove unused imports
-
由 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.
-
- 18 5月, 2015 2 次提交
-
-
由 Arjen Poutsma 提交于
-
由 Arjen Poutsma 提交于
-
- 16 5月, 2015 1 次提交
-
-
由 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
-
- 15 5月, 2015 2 次提交
-
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12750, SPR-12942
-
由 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
-
- 14 5月, 2015 1 次提交
-
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12750
-
- 12 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
(cherry picked from commit a8f75399)
-
- 10 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-11694
-
- 07 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 06 5月, 2015 1 次提交
-
-
由 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
-
- 05 5月, 2015 2 次提交
-
-
由 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
-
由 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
-
- 04 5月, 2015 3 次提交
-
-
由 Rossen Stoyanchev 提交于
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12960
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12956
-
- 24 4月, 2015 1 次提交
-
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12296
-
- 20 4月, 2015 1 次提交
-
-
由 Sebastien Deleuze 提交于
Issue: SPR-12597
-
- 17 4月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12925
-
- 07 4月, 2015 2 次提交
-
-
由 Rossen Stoyanchev 提交于
Issue: SPR-12854
-
由 Rossen Stoyanchev 提交于
Issue: SPR-10153
-
- 03 4月, 2015 1 次提交
-
-
由 Rossen Stoyanchev 提交于
-
- 02 4月, 2015 1 次提交
-
-
由 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
-
- 01 4月, 2015 2 次提交
-
-
由 Rossen Stoyanchev 提交于
-
由 Arjen Poutsma 提交于
This commit introduces support for "Path Segment URI Variable expansion", see https://tools.ietf.org/html/rfc6570#section-3.2.6. In practice, this means that URI template variables prefixed with a '/' are treated like path segments and - as such - will encode any '/' found. For example: {/foo} expanded with "bar/baz" with result in "bar%2F". Issue: SPR-12750
-
- 31 3月, 2015 2 次提交
-
-
由 Juergen Hoeller 提交于
AbstractContextLoaderInitializer and AbstractDispatcherServletInitializer support ApplicationContextInitializers now Issue: SPR-12430
-
由 Juergen Hoeller 提交于
Issue: SPR-12865
-