Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
d293c224
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,发现更多精彩内容 >>
提交
d293c224
编写于
11月 10, 2009
作者:
L
Luke Taylor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SPR-5430,SPR-6224: Converted deprecated view property names to use '.(class)' syntax.
上级
f91d4469
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
15 deletion
+16
-15
spring-framework-reference/src/mvc.xml
spring-framework-reference/src/mvc.xml
+4
-3
spring-framework-reference/src/view.xml
spring-framework-reference/src/view.xml
+12
-12
未找到文件。
spring-framework-reference/src/mvc.xml
浏览文件 @
d293c224
...
...
@@ -1891,10 +1891,11 @@ public class TimeBasedAccessInterceptor extends HandlerInterceptorAdapter {
<para>
The
<classname>
ResourceBundleViewResolver
</classname>
inspects the
<classname>
ResourceBundle
</classname>
identified by the basename, and
for each view it is supposed to resolve, it uses the value of the
property
<literal>
[viewname].class
</literal>
as the view class and the
value of the property
<literal>
[viewname].url
</literal>
as the view url.
property
<literal>
[viewname].(class)
</literal>
as the view class and the
value of the property
<literal>
[viewname].url
</literal>
as the view url.
Examples can be found in the next chapter which covers view technologies.
As you can see, you can identify a parent view, from which all views in
the properties file
sort of extend.
<!--Pls. revise last line. Can you say *extend* instead of *sort of extend*? -->
This
the properties file
<quote>
extend
</quote>
.
This
way you can specify a default view class, for example.
</para>
<note>
...
...
spring-framework-reference/src/view.xml
浏览文件 @
d293c224
...
...
@@ -42,10 +42,10 @@
<
/bean
>
<lineannotation>
# And a sample properties file is uses (views.properties in WEB-INF/classes):
</lineannotation>
welcome.
class
=org.springframework.web.servlet.view.JstlView
welcome.
(class)
=org.springframework.web.servlet.view.JstlView
welcome.url=/WEB-INF/jsp/welcome.jsp
productList.
class
=org.springframework.web.servlet.view.JstlView
productList.
(class)
=org.springframework.web.servlet.view.JstlView
productList.url=/WEB-INF/jsp/productlist.jsp
</programlisting>
<para>
As you can see, the
...
...
@@ -898,13 +898,13 @@ public String deletePet(@PathVariable int ownerId, @PathVariable int petId) {
<
/bean
>
</programlisting>
<programlisting
language=
"java"
>
...
welcomeView.
class
=org.springframework.web.servlet.view.tiles2.TilesView
welcomeView.
(class)
=org.springframework.web.servlet.view.tiles2.TilesView
welcomeView.url=welcome
<lineannotation>
(this is the name of a Tiles definition)
</lineannotation>
vetsView.
class
=org.springframework.web.servlet.view.tiles2.TilesView
vetsView.
(class)
=org.springframework.web.servlet.view.tiles2.TilesView
vetsView.url=vetsView
<lineannotation>
(again, this is the name of a Tiles definition)
</lineannotation>
findOwnersForm.
class
=org.springframework.web.servlet.view.JstlView
findOwnersForm.
(class)
=org.springframework.web.servlet.view.JstlView
findOwnersForm.url=/WEB-INF/jsp/findOwners.jsp
...
</programlisting>
...
...
@@ -1781,13 +1781,13 @@ public class HomePage extends AbstractXsltView {
examples above) looks like this for the one-view application that is
'My First Words':
</para>
<programlisting>
home.
class
=xslt.HomePage
<programlisting>
home.
(class)
=xslt.HomePage
home.stylesheetLocation=/WEB-INF/xsl/home.xslt
home.root=words
</programlisting>
<para>
Here, you can see how the view is tied in with the
<classname>
HomePage
</classname>
class just written which handles the
model domification in the first property
<literal>
'.
class
'
</literal>
.
model domification in the first property
<literal>
'.
(class)
'
</literal>
.
The
<literal>
'stylesheetLocation'
</literal>
property points to the
XSLT file which will handle the XML transformation into HTML for us
and the final property
<literal>
'.root'
</literal>
is the name that
...
...
@@ -1901,13 +1901,13 @@ home.root=words</programlisting>
The entire file now looks like this with the XSLT view shown from
earlier:
</para>
<programlisting>
home.
class
=xslt.HomePage
<programlisting>
home.
(class)
=xslt.HomePage
home.stylesheetLocation=/WEB-INF/xsl/home.xslt
home.root=words
xl.
class
=excel.HomePage
xl.
(class)
=excel.HomePage
pdf.
class
=pdf.HomePage
</programlisting>
pdf.
(class)
=pdf.HomePage
</programlisting>
<para><emphasis>
If you want to start with a
template spreadsheet or a fillable PDF form to add your model data to, specify the location
...
...
@@ -2198,7 +2198,7 @@ public class PDFPage extends AbstractPdfView {
a matter of adding the appropriate entries in the resource bundle
configured in the previous section as shown here:
</para>
<programlisting>
simpleReport.
class
=org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
<programlisting>
simpleReport.
(class)
=org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
simpleReport.url=/WEB-INF/reports/DataSourceReport.jasper
</programlisting>
<para>
Here you can see that the view with name
...
...
@@ -2368,7 +2368,7 @@ HttpServletResponse response) throws Exception {
are being added to the model. To ensure that the correct one is used, we
simply modify our view configuration as appropriate:
</para>
<programlisting>
simpleReport.
class
=org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
<programlisting>
simpleReport.
(class)
=org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
simpleReport.url=/WEB-INF/reports/DataSourceReport.jasper
simpleReport.reportDataKey=myBeanData
</programlisting>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录