Skip to content

Commit 97ea436

Browse files
committed
Polishing
1 parent e2518e0 commit 97ea436

File tree

6 files changed

+38
-35
lines changed

6 files changed

+38
-35
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/NoSuchBeanDefinitionException.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,21 +20,23 @@
2020
import org.springframework.util.StringUtils;
2121

2222
/**
23-
* Exception thrown when a {@code BeanFactory} is asked for a bean instance
24-
* for which it cannot find a definition.
23+
* Exception thrown when a {@code BeanFactory} is asked for a bean instance for which it
24+
* cannot find a definition. This may point to a non-existing bean, a non-unique bean,
25+
* or a manually registered singleton instance without an associated bean definition.
2526
*
2627
* @author Rod Johnson
2728
* @author Juergen Hoeller
2829
* @see BeanFactory#getBean(String)
2930
* @see BeanFactory#getBean(Class)
31+
* @see NoUniqueBeanDefinitionException
3032
*/
3133
@SuppressWarnings("serial")
3234
public class NoSuchBeanDefinitionException extends BeansException {
3335

34-
/** Name of the missing bean. */
36+
/** Name of the missing bean */
3537
private String beanName;
3638

37-
/** Required type of the missing bean. */
39+
/** Required type of the missing bean */
3840
private Class<?> beanType;
3941

4042

spring-webmvc-tiles2/src/main/java/org/springframework/web/servlet/view/tiles2/TilesView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ public class TilesView extends AbstractUrlBasedView {
6262
* Specify whether to always include the view rather than forward to it.
6363
* <p>Default is "false". Switch this flag on to enforce the use of a
6464
* Servlet include, even if a forward would be possible.
65-
* @see TilesViewResolver#setAlwaysInclude(Boolean)
6665
* @since 4.1.2
66+
* @see TilesViewResolver#setAlwaysInclude
6767
*/
6868
public void setAlwaysInclude(boolean alwaysInclude) {
6969
this.alwaysInclude = alwaysInclude;
7070
}
7171

72+
7273
@Override
7374
public boolean checkResource(final Locale locale) throws Exception {
7475
TilesContainer container = ServletUtil.getContainer(getServletContext());

spring-webmvc-tiles2/src/main/java/org/springframework/web/servlet/view/tiles2/TilesViewResolver.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,26 @@ public TilesViewResolver() {
4848
setViewClass(requiredViewClass());
4949
}
5050

51+
52+
/**
53+
* This resolver requires {@link TilesView}.
54+
*/
55+
@Override
56+
protected Class<?> requiredViewClass() {
57+
return TilesView.class;
58+
}
59+
5160
/**
5261
* Specify whether to always include the view rather than forward to it.
5362
* <p>Default is "false". Switch this flag on to enforce the use of a
5463
* Servlet include, even if a forward would be possible.
55-
* @see TilesView#setAlwaysInclude
5664
* @since 4.1.2
65+
* @see TilesView#setAlwaysInclude
5766
*/
5867
public void setAlwaysInclude(Boolean alwaysInclude) {
5968
this.alwaysInclude = alwaysInclude;
6069
}
6170

62-
/**
63-
* Requires {@link TilesView}.
64-
*/
65-
@Override
66-
protected Class<?> requiredViewClass() {
67-
return TilesView.class;
68-
}
6971

7072
@Override
7173
protected AbstractUrlBasedView buildView(String viewName) throws Exception {

spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlProvider.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void setUrlPathHelper(UrlPathHelper pathHelper) {
7070
}
7171

7272
/**
73-
* @return the configured {@code UrlPathHelper}.
73+
* Return the configured {@code UrlPathHelper}.
7474
*/
7575
public UrlPathHelper getPathHelper() {
7676
return this.pathHelper;
@@ -85,15 +85,14 @@ public void setPathMatcher(PathMatcher pathMatcher) {
8585
}
8686

8787
/**
88-
* @return the configured {@code PathMatcher}.
88+
* Return the configured {@code PathMatcher}.
8989
*/
9090
public PathMatcher getPathMatcher() {
9191
return this.pathMatcher;
9292
}
9393

9494
/**
9595
* Manually configure the resource mappings.
96-
*
9796
* <p><strong>Note:</strong> by default resource mappings are auto-detected
9897
* from the Spring {@code ApplicationContext}. However if this property is
9998
* used, the auto-detection is turned off.
@@ -107,15 +106,15 @@ public void setHandlerMap(Map<String, ResourceHttpRequestHandler> handlerMap) {
107106
}
108107

109108
/**
110-
* @return the resource mappings, either manually configured or auto-detected
109+
* Return the resource mappings, either manually configured or auto-detected
111110
* when the Spring {@code ApplicationContext} is refreshed.
112111
*/
113112
public Map<String, ResourceHttpRequestHandler> getHandlerMap() {
114113
return this.handlerMap;
115114
}
116115

117116
/**
118-
* @return {@code false} if resource mappings were manually configured,
117+
* Return {@code false} if resource mappings were manually configured,
119118
* {@code true} otherwise.
120119
*/
121120
public boolean isAutodetect() {
@@ -134,7 +133,6 @@ public void onApplicationEvent(ContextRefreshedEvent event) {
134133
}
135134

136135
protected void detectResourceHandlers(ApplicationContext appContext) {
137-
138136
logger.debug("Looking for resource handler mappings");
139137

140138
Map<String, SimpleUrlHandlerMapping> map = appContext.getBeansOfType(SimpleUrlHandlerMapping.class);
@@ -162,7 +160,6 @@ protected void detectResourceHandlers(ApplicationContext appContext) {
162160
* A variation on {@link #getForLookupPath(String)} that accepts a full request
163161
* URL path (i.e. including context and servlet path) and returns the full request
164162
* URL path to expose for public use.
165-
*
166163
* @param request the current request
167164
* @param requestUrl the request URL path to resolve
168165
* @return the resolved public URL path or {@code null} if unresolved
@@ -189,12 +186,10 @@ private int getLookupPathIndex(HttpServletRequest request) {
189186
* if a match is found use the {@code ResourceResolver} chain of the matched
190187
* {@code ResourceHttpRequestHandler} to resolve the URL path to expose for
191188
* public use.
192-
*
193-
* <p>It is expected the given path is what Spring MVC would use for request
194-
* mapping purposes, i.e. excluding context and servlet path portions.
195-
*
189+
* <p>It is expected that the given path is what Spring MVC would use for
190+
* request mapping purposes, i.e. excluding context and servlet path portions.
196191
* @param lookupPath the lookup path to check
197-
* @return the resolved public URL path or {@code null} if unresolved
192+
* @return the resolved public URL path, or {@code null} if unresolved
198193
*/
199194
public final String getForLookupPath(String lookupPath) {
200195
if (logger.isTraceEnabled()) {

spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles3/TilesView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ protected void setExposeJstlAttributes(boolean exposeJstlAttributes) {
8181
* Specify whether to always include the view rather than forward to it.
8282
* <p>Default is "false". Switch this flag on to enforce the use of a
8383
* Servlet include, even if a forward would be possible.
84-
* @see TilesViewResolver#setAlwaysInclude(Boolean)
8584
* @since 4.1.2
85+
* @see TilesViewResolver#setAlwaysInclude
8686
*/
8787
public void setAlwaysInclude(boolean alwaysInclude) {
8888
this.alwaysInclude = alwaysInclude;
@@ -99,6 +99,7 @@ public void afterPropertiesSet() throws Exception {
9999
}
100100
}
101101

102+
102103
@Override
103104
public boolean checkResource(final Locale locale) throws Exception {
104105
HttpServletRequest servletRequest = null;

spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles3/TilesViewResolver.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ public TilesViewResolver() {
4141
setViewClass(requiredViewClass());
4242
}
4343

44+
45+
/**
46+
* This resolver requires {@link TilesView}.
47+
*/
48+
@Override
49+
protected Class<?> requiredViewClass() {
50+
return TilesView.class;
51+
}
52+
4453
/**
4554
* Set the {@link Renderer} to use. If not specified, a default
4655
* {@link org.apache.tiles.renderer.DefinitionRenderer} will be used.
@@ -54,20 +63,13 @@ public void setRenderer(Renderer renderer) {
5463
* Specify whether to always include the view rather than forward to it.
5564
* <p>Default is "false". Switch this flag on to enforce the use of a
5665
* Servlet include, even if a forward would be possible.
57-
* @see TilesView#setAlwaysInclude
5866
* @since 4.1.2
67+
* @see TilesView#setAlwaysInclude
5968
*/
6069
public void setAlwaysInclude(Boolean alwaysInclude) {
6170
this.alwaysInclude = alwaysInclude;
6271
}
6372

64-
/**
65-
* Requires {@link TilesView}.
66-
*/
67-
@Override
68-
protected Class<?> requiredViewClass() {
69-
return TilesView.class;
70-
}
7173

7274
@Override
7375
protected TilesView buildView(String viewName) throws Exception {

0 commit comments

Comments
 (0)