Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
92bd2404
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 搜索 >>
提交
92bd2404
编写于
8月 13, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
Issue: SPR-12079
上级
626a5fe4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
36 deletion
+39
-36
spring-web/src/main/java/org/springframework/web/context/support/WebApplicationObjectSupport.java
...work/web/context/support/WebApplicationObjectSupport.java
+9
-6
spring-webmvc/src/main/java/org/springframework/web/servlet/view/ResourceBundleViewResolver.java
...ramework/web/servlet/view/ResourceBundleViewResolver.java
+16
-18
spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java
...org/springframework/web/servlet/view/XmlViewResolver.java
+14
-12
未找到文件。
spring-web/src/main/java/org/springframework/web/context/support/WebApplicationObjectSupport.java
浏览文件 @
92bd2404
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
4
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -26,16 +26,19 @@ import org.springframework.web.context.WebApplicationContext;
import
org.springframework.web.util.WebUtils
;
/**
* Convenient superclass for application objects running in a WebApplicationContext.
* Provides {@code getWebApplicationContext()}, {@code getServletContext()},
* and {@code getTempDir()} methods.
* Convenient superclass for application objects running in a {@link WebApplicationContext}.
* Provides {@code getWebApplicationContext()}, {@code getServletContext()}, and
* {@code getTempDir()} accessors.
*
* <p>Note: It is generally recommended to use individual callback interfaces for the actual
* callbacks needed. This broad base class is primarily intended for use within the framework,
* in case of {@link ServletContext} access etc typically being needed.
*
* @author Juergen Hoeller
* @since 28.08.2003
* @see SpringBeanAutowiringSupport
*/
public
abstract
class
WebApplicationObjectSupport
extends
ApplicationObjectSupport
implements
ServletContextAware
{
public
abstract
class
WebApplicationObjectSupport
extends
ApplicationObjectSupport
implements
ServletContextAware
{
private
ServletContext
servletContext
;
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/ResourceBundleViewResolver.java
浏览文件 @
92bd2404
...
...
@@ -36,24 +36,22 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
import
org.springframework.web.servlet.View
;
/**
* {@link org.springframework.web.servlet.ViewResolver} implementation
* that uses bean definitions in a {@link ResourceBundle}, specified by
* the bundle basename.
* A {@link org.springframework.web.servlet.ViewResolver} implementation that uses
* bean definitions in a {@link ResourceBundle}, specified by the bundle basename.
*
* <p>The bundle is typically defined in a properties file, located in
*
the class path.
The default bundle basename is "views".
* <p>The bundle is typically defined in a properties file, located in
the classpath.
* The default bundle basename is "views".
*
* <p>This {@code ViewResolver} supports localized view definitions,
* using the default support of {@link java.util.PropertyResourceBundle}.
* For example, the basename "views" will be resolved as class path resources
* "views_de_AT.properties", "views_de.properties", "views.properties" -
* for a given Locale "de_AT".
* <p>This {@code ViewResolver} supports localized view definitions, using the
* default support of {@link java.util.PropertyResourceBundle}. For example, the
* basename "views" will be resolved as class path resources "views_de_AT.properties",
* "views_de.properties", "views.properties" - for a given Locale "de_AT".
*
* <p>Note:
this {@code ViewResolver} implements the {@link Ordered}
* in
terface to allow for flexible participation in {@code ViewResolver}
*
chaining. For example, some special views could be defined via this
*
{@code ViewResolver} (giving it 0 as "order" value), while all
*
remaining views could be resolved by
a {@link UrlBasedViewResolver}.
* <p>Note:
This {@code ViewResolver} implements the {@link Ordered} interface
* in
order to allow for flexible participation in {@code ViewResolver} chaining.
*
For example, some special views could be defined via this {@code ViewResolver}
*
(giving it 0 as "order" value), while all remaining views could be resolved by
* a {@link UrlBasedViewResolver}.
*
* @author Rod Johnson
* @author Juergen Hoeller
...
...
@@ -110,7 +108,7 @@ public class ResourceBundleViewResolver extends AbstractCachingViewResolver
* @see java.util.ResourceBundle#getBundle(String)
*/
public
void
setBasename
(
String
basename
)
{
setBasenames
(
new
String
[]
{
basename
}
);
setBasenames
(
basename
);
}
/**
...
...
@@ -173,7 +171,7 @@ public class ResourceBundleViewResolver extends AbstractCachingViewResolver
* <p>Allows for pre-initialization of common Locales, eagerly checking
* the view configuration for those Locales.
*/
public
void
setLocalesToInitialize
(
Locale
[]
localesToInitialize
)
{
public
void
setLocalesToInitialize
(
Locale
...
localesToInitialize
)
{
this
.
localesToInitialize
=
localesToInitialize
;
}
...
...
@@ -198,7 +196,7 @@ public class ResourceBundleViewResolver extends AbstractCachingViewResolver
return
factory
.
getBean
(
viewName
,
View
.
class
);
}
catch
(
NoSuchBeanDefinitionException
ex
)
{
//
to allow for ViewResolver chaining
//
Allow for ViewResolver chaining...
return
null
;
}
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java
浏览文件 @
92bd2404
...
...
@@ -32,18 +32,20 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
import
org.springframework.web.servlet.View
;
/**
* Implementation of ViewResolver that uses bean definitions in an
* XML file, specified by resource location. The file will typically
* be located in the WEB-INF directory; default is "/WEB-INF/views.xml".
* A {@link org.springframework.web.servlet.ViewResolver} implementation that uses
* bean definitions in a dedicated XML file for view definitions, specified by
* resource location. The file will typically be located in the WEB-INF directory;
* the default is "/WEB-INF/views.xml".
*
* <p>This
ViewResolver does not support internationalization.
*
Consider ResourceBundleViewResolver if you need to apply
* different view resources per locale.
* <p>This
{@code ViewResolver} does not support internationalization at the level
*
of its definition resources. Consider {@link ResourceBundleViewResolver} if you
*
need to apply
different view resources per locale.
*
* <p>Note: This ViewResolver implements the Ordered interface to allow for
* flexible participation in ViewResolver chaining. For example, some special
* views could be defined via this ViewResolver (giving it 0 as "order" value),
* while all remaining views could be resolved by a UrlBasedViewResolver.
* <p>Note: This {@code ViewResolver} implements the {@link Ordered} interface
* in order to allow for flexible participation in {@code ViewResolver} chaining.
* For example, some special views could be defined via this {@code ViewResolver}
* (giving it 0 as "order" value), while all remaining views could be resolved by
* a {@link UrlBasedViewResolver}.
*
* @author Juergen Hoeller
* @since 18.06.2003
...
...
@@ -71,7 +73,7 @@ public class XmlViewResolver extends AbstractCachingViewResolver
@Override
public
int
getOrder
()
{
return
order
;
return
this
.
order
;
}
/**
...
...
@@ -111,7 +113,7 @@ public class XmlViewResolver extends AbstractCachingViewResolver
return
factory
.
getBean
(
viewName
,
View
.
class
);
}
catch
(
NoSuchBeanDefinitionException
ex
)
{
//
to allow for ViewResolver chaining
//
Allow for ViewResolver chaining...
return
null
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录