分享
 
 
 

SCWCD1.4的资料

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

开始复习的是080。

看了几位前辈的帖子,才知道081和080有很大的不同。

以下为增加的两部分,为EL和JSTL。

Chapter 7. Building JSP Pages Using the Expression Language (EL)

Given a scenario(方案;情况;概要), write EL code that accesses the following implicit variables including: pageScope, requestScope, sessionScope, and applicationScope, param and paramValues, header and headerValues, cookie, initParam and pageContext. There are several implicit objects that are available to EL expressions used in JSP pages. These objects are always available under these names(讲的是EL的隐含对象和简单的说明)

然后举了几个例子,有EL的.运算和[]运算。

Chapter 9. Building JSP Pages Using Tag Libraries

For a custom tag library or a library of Tag Files, create the 'taglib' directive for a JSP page. The set of significant(有意义的, 重大的, 重要的) tags a JSP container interprets (解释, 说明)can be extended through a tag library.

The taglib directive in a JSP page declares that the page uses a tag library, uniquely(独特地,唯一地,珍奇地) identifies the tag library using a URI and associates(使发生联系, 使联合) a tag prefix that will distinguish usage of the actions in the library.

If a JSP container implementation cannot locate a tag library description, a fatal translation error shall result.

It is a fatal translation error for the taglib directive to appear after actions or functions using the prefix.

In the following example, a tag library is introduced and made available to this page using the super prefix; no other tag libraries should be introduced in this page using this prefix. In this particular case, we assume the tag library includes a doMagic element type, which is used within the page.

JSTL增加的部分:

Given a design goal, use an appropriate(适当的) JSP Standard Tag Library (JSTL v1.1) tag from the "core" tag library.

The center of JSTL is the core taglib. This can be split into five areas:

General purpose

Variables support

Conditional

Iterator

URL Related

To use the core library, use the following directive:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

The prefix attribute specifies(指定,规定,确定) the prefix used in the tag name for a particular library. For example, the core library includes a tag named out. When combined with a prefix of c, the full tag would be <c:out>. You are free to use any prefix you like, but you must use different prefixes for each of the four standard tag libraries.

You must also put the corresponding(相应的) .tld file for each tag library in your /WEB-INF directory and use the taglib element in your web.xml file to include the tag library:

<taglib>

<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>

<taglib-location>/WEB-INF/tld/core.tld</taglib-location>

</taglib>

General purpose tags.

The general-purpose tags let you display variable values, and enclose(封闭,密封;包装,包围) a group of tags within a try-catch block.

The <c:out> action provides a capability(能力, 性能, 容量)similar to JSP expressions such as <%= scripting-language-expression %> or ${el-expression}. For example:

You have <c:out value="${sessionScope.user.itemCount}"/> items.

The <c:catch> action allows page authors to handle errors from any action in a uniform(统一的, 相同的) fashion, and allows for error handling for multiple actions at once. <c:catch> provides page authors with granular(粒度[状) error handling: Actions that are of central importance to a page should not be encapsulated(密封) in a <c:catch>, so their exceptions will propagate to an error page, whereas actions with secondary importance to the page should be wrapped in a <c:catch>, so they never cause the error page mechanism to be invoked(调用). The exception thrown is stored in the scoped variable identified by var, which always has page scope. If no exception occurred, the scoped variable identified by var is removed if it existed. If var is missing, the exception is simply caught and not saved.

<c:catch [var="varName"]>

nested(嵌套的) actions

</c:catch>

这部分基本上涉及了JSTL的所有内容。

包括<c:out><c:set><c:catch><c:when><c:choose><c:remove><c:forTokens><c:forEach><c:if>

还有<c:url><c:import><c:redirect>

详细内容见http://java.boot.by/wcd-guide/ch09s03.html

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有