Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
d3ea2420
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,体验更适合开发者的 AI 搜索 >>
提交
d3ea2420
编写于
9月 17, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
40cd277b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
34 deletion
+38
-34
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
...servlet/config/annotation/WebMvcConfigurationSupport.java
+38
-34
未找到文件。
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
浏览文件 @
d3ea2420
...
...
@@ -153,14 +153,13 @@ import org.springframework.web.util.UrlPathHelper;
* libraries available on the classpath.
* </ul>
*
* @see EnableWebMvc
* @see WebMvcConfigurer
* @see WebMvcConfigurerAdapter
*
* @author Rossen Stoyanchev
* @author Brian Clozel
* @author Sebastien Deleuze
* @since 3.1
* @see EnableWebMvc
* @see WebMvcConfigurer
* @see WebMvcConfigurerAdapter
*/
public
class
WebMvcConfigurationSupport
implements
ApplicationContextAware
,
ServletContextAware
{
...
...
@@ -181,34 +180,34 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
ClassUtils
.
isPresent
(
"com.google.gson.Gson"
,
WebMvcConfigurationSupport
.
class
.
getClassLoader
());
private
ServletContext
servletContext
;
private
ApplicationContext
applicationContext
;
private
ServletContext
servletContext
;
private
List
<
Object
>
interceptors
;
private
PathMatchConfigurer
pathMatchConfigurer
;
private
ContentNegotiationManager
contentNegotiationManager
;
private
List
<
HttpMessageConverter
<?>>
messageConverters
;
private
PathMatchConfigurer
pathMatchConfigurer
;
/**
* Set the {@link javax.servlet.ServletContext}, e.g. for resource handling,
* looking up file extensions, etc.
* Set the Spring {@link ApplicationContext}, e.g. for resource loading.
*/
@Override
public
void
set
ServletContext
(
ServletContext
servlet
Context
)
{
this
.
servletContext
=
servlet
Context
;
public
void
set
ApplicationContext
(
ApplicationContext
application
Context
)
{
this
.
applicationContext
=
application
Context
;
}
/**
* Set the Spring {@link ApplicationContext}, e.g. for resource loading.
* Set the {@link javax.servlet.ServletContext}, e.g. for resource handling,
* looking up file extensions, etc.
*/
@Override
public
void
set
ApplicationContext
(
ApplicationContext
application
Context
)
{
this
.
applicationContext
=
application
Context
;
public
void
set
ServletContext
(
ServletContext
servlet
Context
)
{
this
.
servletContext
=
servlet
Context
;
}
...
...
@@ -239,23 +238,8 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
if
(
configurer
.
getUrlPathHelper
()
!=
null
)
{
handlerMapping
.
setUrlPathHelper
(
configurer
.
getUrlPathHelper
());
}
return
handlerMapping
;
}
protected
PathMatchConfigurer
getPathMatchConfigurer
()
{
if
(
this
.
pathMatchConfigurer
==
null
)
{
this
.
pathMatchConfigurer
=
new
PathMatchConfigurer
();
configurePathMatch
(
this
.
pathMatchConfigurer
);
}
return
this
.
pathMatchConfigurer
;
}
/**
* Override this method to configure path matching options.
* @see PathMatchConfigurer
* @since 4.0.3
*/
public
void
configurePathMatch
(
PathMatchConfigurer
configurer
)
{
return
handlerMapping
;
}
/**
...
...
@@ -282,6 +266,27 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
protected
void
addInterceptors
(
InterceptorRegistry
registry
)
{
}
/**
* Callback for building the {@link PathMatchConfigurer}.
* Delegates to {@link #configurePathMatch}.
* @since 4.1
*/
protected
PathMatchConfigurer
getPathMatchConfigurer
()
{
if
(
this
.
pathMatchConfigurer
==
null
)
{
this
.
pathMatchConfigurer
=
new
PathMatchConfigurer
();
configurePathMatch
(
this
.
pathMatchConfigurer
);
}
return
this
.
pathMatchConfigurer
;
}
/**
* Override this method to configure path matching options.
* @see PathMatchConfigurer
* @since 4.0.3
*/
public
void
configurePathMatch
(
PathMatchConfigurer
configurer
)
{
}
/**
* Return a {@link ContentNegotiationManager} instance to use to determine
* requested {@linkplain MediaType media types} in a given request.
...
...
@@ -295,8 +300,8 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
try
{
this
.
contentNegotiationManager
=
configurer
.
getContentNegotiationManager
();
}
catch
(
Exception
e
)
{
throw
new
BeanInitializationException
(
"Could not create ContentNegotiationManager"
,
e
);
catch
(
Exception
e
x
)
{
throw
new
BeanInitializationException
(
"Could not create ContentNegotiationManager"
,
e
x
);
}
}
return
this
.
contentNegotiationManager
;
...
...
@@ -680,7 +685,6 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
public
void
configureAsyncSupport
(
AsyncSupportConfigurer
configurer
)
{
}
/**
* Return an instance of {@link CompositeUriComponentsContributor} for use with
* {@link org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder}.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录