Skip to content

Commit 03c3dc3

Browse files
committed
Clarified ServletConfigAware behavior in case of no ServletConfig being available
Issue: SPR-9855
1 parent 9caf672 commit 03c3dc3

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

org.springframework.web/src/main/java/org/springframework/web/context/ServletConfigAware.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 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.
@@ -21,13 +21,12 @@
2121
import org.springframework.beans.factory.Aware;
2222

2323
/**
24-
* Interface to be implemented by any object that wishes to be notified
25-
* of the ServletConfig (typically determined by the WebApplicationContext)
24+
* Interface to be implemented by any object that wishes to be notified of the
25+
* {@link ServletConfig} (typically determined by the {@link WebApplicationContext})
2626
* that it runs in.
2727
*
28-
* <p>Only satisfied if actually running within a Servlet-specific
29-
* WebApplicationContext. If this callback interface is encountered
30-
* elsewhere, an exception will be thrown on bean creation.
28+
* <p>Note: Only satisfied if actually running within a Servlet-specific
29+
* WebApplicationContext. Otherwise, no ServletConfig will be set.
3130
*
3231
* @author Juergen Hoeller
3332
* @author Chris Beams
@@ -37,7 +36,7 @@
3736
public interface ServletConfigAware extends Aware {
3837

3938
/**
40-
* Set the ServletConfig that this object runs in.
39+
* Set the {@link ServletConfig} that this object runs in.
4140
* <p>Invoked after population of normal bean properties but before an init
4241
* callback like InitializingBean's <code>afterPropertiesSet</code> or a
4342
* custom init-method. Invoked after ApplicationContextAware's

org.springframework.web/src/main/java/org/springframework/web/context/ServletContextAware.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
3-
*
2+
* Copyright 2002-2012 the original author or authors.
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,8 +21,8 @@
2121
import org.springframework.beans.factory.Aware;
2222

2323
/**
24-
* Interface to be implemented by any object that wishes to be notified
25-
* of the ServletContext (typically determined by the WebApplicationContext)
24+
* Interface to be implemented by any object that wishes to be notified of the
25+
* {@link ServletContext} (typically determined by the {@link WebApplicationContext})
2626
* that it runs in.
2727
*
2828
* @author Juergen Hoeller
@@ -33,7 +33,7 @@
3333
public interface ServletContextAware extends Aware {
3434

3535
/**
36-
* Set the ServletContext that this object runs in.
36+
* Set the {@link ServletContext} that this object runs in.
3737
* <p>Invoked after population of normal bean properties but before an init
3838
* callback like InitializingBean's <code>afterPropertiesSet</code> or a
3939
* custom init-method. Invoked after ApplicationContextAware's

0 commit comments

Comments
 (0)