diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java index fc378c5a8d..a9025dc94d 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java @@ -48,8 +48,13 @@ import org.springframework.util.Assert; import org.springframework.util.ReflectionUtils; /** - * Enhances {@link Configuration} classes by generating a CGLIB subclass capable of - * interacting with the Spring container to respect bean semantics. + * Enhances {@link Configuration} classes by generating a CGLIB subclass which + * interacts with the Spring container to respect bean scoping semantics for + * {@code @Bean} methods. Each such {@code @Bean} method will be overridden in + * the generated subclass, only delegating to the actual {@code @Bean} method + * implementation if the container actually requests the construction of a new + * instance. Otherwise, a call to such an {@code @Bean} method serves as a + * reference back to the container, obtaining the corresponding bean by name. * * @author Chris Beams * @author Juergen Hoeller diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java index bd844d223e..95453a88b7 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java @@ -39,7 +39,7 @@ import org.springframework.web.servlet.view.AbstractView; /** * Spring MVC {@link View} that renders JSON content by serializing the model for the current request - * using Jackson's {@link ObjectMapper}. + * using Jackson 1.x's {@link ObjectMapper}. * *
By default, the entire contents of the model map (with the exception of framework-specific classes)
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as JSON
diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/json/MappingJacksonJsonViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/json/MappingJacksonJsonViewTests.java
index 957301df52..92aa6fc8fc 100644
--- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/json/MappingJacksonJsonViewTests.java
+++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/json/MappingJacksonJsonViewTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ import org.junit.Test;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.ScriptableObject;
+
import org.springframework.mock.web.test.MockHttpServletRequest;
import org.springframework.mock.web.test.MockHttpServletResponse;
import org.springframework.ui.ModelMap;
@@ -68,10 +69,8 @@ public class MappingJacksonJsonViewTests {
public void setUp() {
request = new MockHttpServletRequest();
response = new MockHttpServletResponse();
-
jsContext = ContextFactory.getGlobal().enterContext();
jsScope = jsContext.initStandardObjects();
-
view = new MappingJacksonJsonView();
}
@@ -93,13 +92,11 @@ public class MappingJacksonJsonViewTests {
assertEquals("no-cache", response.getHeader("Pragma"));
assertEquals("no-cache, no-store, max-age=0", response.getHeader("Cache-Control"));
assertNotNull(response.getHeader("Expires"));
-
assertEquals(MappingJacksonJsonView.DEFAULT_CONTENT_TYPE, response.getContentType());
String jsonResult = response.getContentAsString();
assertTrue(jsonResult.length() > 0);
assertEquals(jsonResult.length(), response.getContentLength());
-
validateResult();
}
@@ -110,7 +107,6 @@ public class MappingJacksonJsonViewTests {
Map