View | Details | Raw Unified | Return to bug 54284
Collapse All | Expand All

(-)org/apache/catalina/core/LocalStrings.properties (+2 lines)
Lines 21-26 Link Here
21
applicationContext.addRole.ise=Roles can not be added to context {0} as the context has been initialised
21
applicationContext.addRole.ise=Roles can not be added to context {0} as the context has been initialised
22
applicationContext.addServlet.ise=Servlets can not be added to context {0} as the context has been initialised
22
applicationContext.addServlet.ise=Servlets can not be added to context {0} as the context has been initialised
23
applicationContext.attributeEvent=Exception thrown by attributes event listener
23
applicationContext.attributeEvent=Exception thrown by attributes event listener
24
applicationContext.invalidFilterName=Unable to add filter definition due to invalid filter name [{0}].
25
applicationContext.invalidServletName=Unable to add servlet definition due to invalid servlet name [{0}].
24
applicationContext.mapping.error=Error during mapping
26
applicationContext.mapping.error=Error during mapping
25
applicationContext.requestDispatcher.iae=Path {0} does not start with a "/" character
27
applicationContext.requestDispatcher.iae=Path {0} does not start with a "/" character
26
applicationContext.resourcePaths.iae=Path {0} does not start with a "/" character
28
applicationContext.resourcePaths.iae=Path {0} does not start with a "/" character
(-)org/apache/catalina/core/ApplicationContext.java (-2 / +12 lines)
Lines 943-949 Link Here
943
943
944
    private FilterRegistration.Dynamic addFilter(String filterName,
944
    private FilterRegistration.Dynamic addFilter(String filterName,
945
            String filterClass, Filter filter) throws IllegalStateException {
945
            String filterClass, Filter filter) throws IllegalStateException {
946
        
946
947
        if (filterName == null || filterName.equals("")) {
948
            throw new IllegalArgumentException(
949
                    sm.getString("applicationContext.invalidFilterName", filterName));
950
        }
951
947
        if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
952
        if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
948
            //TODO Spec breaking enhancement to ignore this restriction
953
            //TODO Spec breaking enhancement to ignore this restriction
949
            throw new IllegalStateException(
954
            throw new IllegalStateException(
Lines 1083-1089 Link Here
1083
1088
1084
    private ServletRegistration.Dynamic addServlet(String servletName,
1089
    private ServletRegistration.Dynamic addServlet(String servletName,
1085
            String servletClass, Servlet servlet) throws IllegalStateException {
1090
            String servletClass, Servlet servlet) throws IllegalStateException {
1086
        
1091
1092
        if (servletName == null || servletName.equals("")) {
1093
            throw new IllegalArgumentException(
1094
                    sm.getString("applicationContext.invalidServletName", servletName));
1095
        }
1096
1087
        if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
1097
        if (!context.getState().equals(LifecycleState.STARTING_PREP)) {
1088
            //TODO Spec breaking enhancement to ignore this restriction
1098
            //TODO Spec breaking enhancement to ignore this restriction
1089
            throw new IllegalStateException(
1099
            throw new IllegalStateException(
(-)org/apache/catalina/deploy/ServletDef.java (+9 lines)
Lines 25-30 Link Here
25
import java.util.Map;
25
import java.util.Map;
26
import java.util.Set;
26
import java.util.Set;
27
27
28
import org.apache.tomcat.util.res.StringManager;
29
28
30
29
/**
31
/**
30
 * Representation of a servlet definition for a web application, as represented
32
 * Representation of a servlet definition for a web application, as represented
Lines 35-40 Link Here
35
37
36
    private static final long serialVersionUID = 1L;
38
    private static final long serialVersionUID = 1L;
37
39
40
    private static final StringManager sm =
41
        StringManager.getManager(Constants.Package);
42
38
    // ------------------------------------------------------------- Properties
43
    // ------------------------------------------------------------- Properties
39
44
40
45
Lines 104-109 Link Here
104
    }
109
    }
105
110
106
    public void setServletName(String servletName) {
111
    public void setServletName(String servletName) {
112
        if (servletName == null || servletName.equals("")) {
113
            throw new IllegalArgumentException(
114
                    sm.getString("webXml.invalidServletName", servletName));
115
        }
107
        this.servletName = servletName;
116
        this.servletName = servletName;
108
    }
117
    }
109
118
(-)org/apache/catalina/deploy/LocalStrings.properties (+3 lines)
Lines 12-17 Link Here
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
14
# limitations under the License.
15
filterDef.invalidFilterName=Invalid <filter-name> [{0}] in filter definition.
16
17
servletDef.invalidServletName=Invalid <servlet-name> [{0}] in servlet definition.
15
18
16
webXml.duplicateEnvEntry=Duplicate env-entry name [{0}]
19
webXml.duplicateEnvEntry=Duplicate env-entry name [{0}]
17
webXml.duplicateFilter=Duplicate filter name [{0}]
20
webXml.duplicateFilter=Duplicate filter name [{0}]
(-)org/apache/catalina/deploy/FilterDef.java (+9 lines)
Lines 25-30 Link Here
25
25
26
import javax.servlet.Filter;
26
import javax.servlet.Filter;
27
27
28
import org.apache.tomcat.util.res.StringManager;
29
28
30
29
/**
31
/**
30
 * Representation of a filter definition for a web application, as represented
32
 * Representation of a filter definition for a web application, as represented
Lines 38-43 Link Here
38
40
39
    private static final long serialVersionUID = 1L;
41
    private static final long serialVersionUID = 1L;
40
42
43
    private static final StringManager sm =
44
        StringManager.getManager(Constants.Package);
45
41
    // ------------------------------------------------------------- Properties
46
    // ------------------------------------------------------------- Properties
42
47
43
48
Lines 108-113 Link Here
108
    }
113
    }
109
114
110
    public void setFilterName(String filterName) {
115
    public void setFilterName(String filterName) {
116
        if (filterName == null || filterName.equals("")) {
117
            throw new IllegalArgumentException(
118
                    sm.getString("webXml.invalidFilterName", filterName));
119
        }
111
        this.filterName = filterName;
120
        this.filterName = filterName;
112
    }
121
    }
113
122

Return to bug 54284