Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
756bff8e
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
756bff8e
编写于
12月 08, 2012
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve Javadoc in SpringServletContainerInitializer
上级
a436a575
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
12 deletion
+13
-12
spring-web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java
...pringframework/web/SpringServletContainerInitializer.java
+13
-12
未找到文件。
spring-web/src/main/java/org/springframework/web/SpringServletContainerInitializer.java
浏览文件 @
756bff8e
/*
/*
* Copyright 2002-201
1
the original author or authors.
* Copyright 2002-201
2
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -36,7 +36,7 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
...
@@ -36,7 +36,7 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
* {@code web.xml}-based approach.
* {@code web.xml}-based approach.
*
*
* <h2>Mechanism of Operation</h2>
* <h2>Mechanism of Operation</h2>
* This class will be loaded and instantiated and have its {@link #onStartup
onStartup
}
* This class will be loaded and instantiated and have its {@link #onStartup}
* method invoked by any Servlet 3.0-compliant container during container startup assuming
* method invoked by any Servlet 3.0-compliant container during container startup assuming
* that the {@code spring-web} module JAR is present on the classpath. This occurs through
* that the {@code spring-web} module JAR is present on the classpath. This occurs through
* the JAR Services API {@link ServiceLoader#load(Class)} method detecting the
* the JAR Services API {@link ServiceLoader#load(Class)} method detecting the
...
@@ -46,18 +46,18 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
...
@@ -46,18 +46,18 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
* JAR Services API documentation</a> as well as section <em>8.2.4</em> of the Servlet 3.0
* JAR Services API documentation</a> as well as section <em>8.2.4</em> of the Servlet 3.0
* Final Draft specification for complete details.
* Final Draft specification for complete details.
*
*
* <h3>
when i
n combination with {@code web.xml}</h3>
* <h3>
I
n combination with {@code web.xml}</h3>
* <p>If a web application
does include
a {@code WEB-INF/web.xml} file, it is important to
* <p>If a web application
includes
a {@code WEB-INF/web.xml} file, it is important to
* understand that neither this nor any other {@code ServletContextInitializer} will be
* understand that neither this nor any other {@code ServletContextInitializer} will be
* processed unless the {@code <web-app>} element's {@code version} attribute is >= "3.0"
* processed unless the {@code <web-app>} element's {@code version} attribute is >= "3.0"
* and the {@code xsi:schemaLocation} for "http://java.sun.com/xml/ns/javaee" is set to
* and the {@code xsi:schemaLocation} for "http://java.sun.com/xml/ns/javaee" is set to
* "http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd".
* "http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd".
* <p>A web application can choose to limit the amount of classpath scanning the Servlet
* <p>A web application can choose to limit the amount of classpath scanning the Servlet
* container does at startup either through the
metadata-complete
attribute in
* container does at startup either through the
{@code metadata-complete}
attribute in
* {@code web.xml}, which controls scanning for Servlet annotations or through an
* {@code web.xml}, which controls scanning for Servlet annotations or through an
* {@code <absolute-ordering>} element also in {@code web.xml}, which controls which
* {@code <absolute-ordering>} element also in {@code web.xml}, which controls which
* web fragments (i.e. jars) are allowed to perform a {@code ServletContainerInitializer}
* web fragments (i.e. jars) are allowed to perform a {@code ServletContainerInitializer}
* scan. When using this feature, the
Spring's
{@link SpringServletContainerInitializer}
* scan. When using this feature, the {@link SpringServletContainerInitializer}
* can be enabled by adding "spring_web" to the list of named web fragments in
* can be enabled by adding "spring_web" to the list of named web fragments in
* {@code web.xml} as follows:
* {@code web.xml} as follows:
*
*
...
@@ -94,12 +94,13 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
...
@@ -94,12 +94,13 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
* is not in any way "tied" to Spring MVC other than the fact that the types are shipped
* is not in any way "tied" to Spring MVC other than the fact that the types are shipped
* in the {@code spring-web} module JAR. Rather, they can be considered general-purpose
* in the {@code spring-web} module JAR. Rather, they can be considered general-purpose
* in their ability to facilitate convenient code-based configuration of the
* in their ability to facilitate convenient code-based configuration of the
* {@code ServletContext}.
Said another way
, any servlet, listener, or filter may be
* {@code ServletContext}.
In other words
, any servlet, listener, or filter may be
* registered within a {@code WebApplicationInitializer}, not just Spring MVC-specific
* registered within a {@code WebApplicationInitializer}, not just Spring MVC-specific
* components.
* components.
*
*
* <p>This class is not designed for nor intended to be extended. It should be considered
* <p>This class is neither designed for extension nor intended to be extended.
* an internal type, with {@code WebApplicationInitializer} being the public-facing SPI.
* It should be considered an internal type, with {@code WebApplicationInitializer}
* being the public-facing SPI.
*
*
* <h2>See Also</h2>
* <h2>See Also</h2>
* See {@link WebApplicationInitializer} Javadoc for examples and detailed usage
* See {@link WebApplicationInitializer} Javadoc for examples and detailed usage
...
@@ -127,17 +128,17 @@ public class SpringServletContainerInitializer implements ServletContainerInitia
...
@@ -127,17 +128,17 @@ public class SpringServletContainerInitializer implements ServletContainerInitia
* <p>If no {@code WebApplicationInitializer} implementations are found on the
* <p>If no {@code WebApplicationInitializer} implementations are found on the
* classpath, this method is effectively a no-op. An INFO-level log message will be
* classpath, this method is effectively a no-op. An INFO-level log message will be
* issued notifying the user that the {@code ServletContainerInitializer} has indeed
* issued notifying the user that the {@code ServletContainerInitializer} has indeed
* been invoked
,
but that no {@code WebApplicationInitializer} implementations were
* been invoked but that no {@code WebApplicationInitializer} implementations were
* found.
* found.
*
*
* <p>Assuming that one or more {@code WebApplicationInitializer} types are detected,
* <p>Assuming that one or more {@code WebApplicationInitializer} types are detected,
* they will be instantiated (and <em>sorted</em> if the @{@link
* they will be instantiated (and <em>sorted</em> if the @{@link
* org.springframework.core.annotation.Order Order} annotation is present or
* org.springframework.core.annotation.Order
@
Order} annotation is present or
* the {@link org.springframework.core.Ordered Ordered} interface has been
* the {@link org.springframework.core.Ordered Ordered} interface has been
* implemented). Then the {@link WebApplicationInitializer#onStartup(ServletContext)}
* implemented). Then the {@link WebApplicationInitializer#onStartup(ServletContext)}
* method will be invoked on each instance, delegating the {@code ServletContext} such
* method will be invoked on each instance, delegating the {@code ServletContext} such
* that each instance may register and configure servlets such as Spring's
* that each instance may register and configure servlets such as Spring's
* {@code DispatcherServlet}, listeners such as Spring's {@code ContextLoaderListener}
* {@code DispatcherServlet}, listeners such as Spring's {@code ContextLoaderListener}
,
* or any other Servlet API componentry such as filters.
* or any other Servlet API componentry such as filters.
*
*
* @param webAppInitializerClasses all implementations of
* @param webAppInitializerClasses all implementations of
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录