标签库使用指南1-Application标签库

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

1.Application Tag Library

APPLICATION标签库中包含的标签用来访问jsp应用中的所有ApplicationContext信息。

1.1 使用指南:

(1)将标签库描述文件application.tld拷贝到/WEB-INF目录下;

(2)将标签库JAR文件拷贝到/WEB-INF/lib目录下;

(3)在/WEB-INF/web.XML文件中加入配置信息:

http://jakarta.apache.org/taglibs/application-1.0

/WEB-INF/application.tld

(4)在使用标记库的JSP文件中加入引用信息:

1.2 标签说明

1.2.1Application属性标签

标签名attribute

Tag Bodyempty

作用得到application中某个属性的值

使用示例

示例说明输出application中名为test1的属性的值。

标签名attributes

Tag BodyJSP

作用遍历application中所有的属性或得到特定属性的值

使用示例Name: Value:

示例说明输出application中所有属性的名称和值。

使用示例Name: Value:

示例说明输出application中属性myatt的名称和值。

标签名equalsAttribute

Tag BodyJSP

作用判定application中属性的值是否与指定值相等。

使用示例 The application attribute with name test1 matches the string "blah". The application attribute with name test1 does not match the string "blah".

示例说明判定application中属性test1的值是否为blah。

标签名existsAttribute

Tag BodyJSP

作用判定application中是否存在指定名称的属性。

使用示例 The application attribute with name test1 exists. The application attribute with name test1 does not exist.

示例说明判定application中是否有名为test1的属性。

标签名removeAttribute

Tag Bodyempty

作用从application中删除指定名称的属性。

使用示例

示例说明删除application中名为test1的属性。

标签名setAttribute

Tag BodyJSP

作用设定application中指定属性的值。

使用示例Test Value

示例说明设定application中test1的属性值为Test Value。

1.2.2Application初始化参数标签

标签名initParameter

Tag Bodyempty

作用得到application中指定参数的值。

使用示例

示例说明得到application中参数test1的值。

标签名initParameters

Tag BodyJSP

作用遍历application中所有初始化参数或得到特定参数的值。

使用示例Name: Value:

示例说明输出application中所有初始化参数的名称和值。

使用示例Name: Value:

示例说明得到application中参数test1的值。

标签名equalsInitParameter

Tag BodyJSP

作用判定application中某参数的值是否与指定值相同。

使用示例 The initialization parameter with name test1 matches "blah". The initialization parameter with name test1 does not match "blah".

示例说明判定application中参数test1的值是否为blah。

标签名existsInitParameter

Tag BodyJSP

作用判定application中是否存在指定名称的参数。

使用示例 The initializaion parameter with name test1 exists. The initialization parameter with name test1 does not exist.

示例说明判定application中是否存在参数test1。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航