您的位置:首页 > 其它

Chapter 5: Other View Element Types in Screen Widgets

2013-04-10 10:30 309 查看

FreeMarker

我之前对web.xml只有一个很粗略的理解:定义了webapp可以使用的资源。

今天有了进一步的理解:定义了component中所有的parameter!

在party的PartyScreen.xml中有着这样一段代码:

<screen name="findparty">
<section>
<actions>
<set field="titleProperty" value="PageTitleFindParty"/>
<set field="headerItem" value="find"/>
<set field="tabButtonItem" value="findparty"/>
<service service-name="findParty" auto-field-map="parameters"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>


其中,location这里的${parameters.mainDecoratorLocation}就是在web.xml中定义的:

<context-param>

<param-name>mainDecoratorLocation</param-name>
<param-value>component://party/widget/partymgr/CommonScreens.xml</param-value>
<description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description>
</context-param>


所以,这里的${parameters.mainDecoratorLocation}就等价于:"component://party/widget/partymgr/CommonScreens.xml"

自我感觉,这里的context-param有点像C/C++全局变量
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: