SCWCD1.4 's information

Source: Internet
Author: User
Tags error handling expression variables tag name variable tld

The beginning of the review is 080.

Read a few predecessors of the post, only to know that 081 and 080 are very different.

The following are two additional sections, for El and Jstl.

Chapter 7. Building JSP Pages Using the Expression Language (EL)
Given a scenario (scenario; summary), write EL code that accesses the following implicit variables Including:pagescope, REQUESTSCOP E, Sessionscope, and Applicationscope, Param and Paramvalues, header and headervalues, cookies, Initparam and PageContext.
There are several implicit objects that are available to EL expressions into JSP pages. These are objects are always available under these names (speaking of the implied objects and simple descriptions of EL)

And then for a few examples, there are el. Operations and [] operations.
Chapter 9. Building JSP Pages Using tag librariesfor a custom tag library or a library of tag Files, create the ' taglib ' directive fo R a JSP page.
The set of significant (meaningful, significant, important) tags a JSP container interprets (interpretation, description) can be extended through a tag library.

The taglib directive in a JSP page declares the page uses a tag library, uniquely (uniquely, uniquely, exclusively) identifies the tag Lib Rary using a URI and associates (make contact, make union) a tag prefix that would distinguish usage 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 was introduced and made available to this page using the super prefix; No other tag libraries should is introduced in the 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 added section:
Given A design goal, use a appropriate (appropriate) JSP Standard tag Library (JSTL v1.1) tag from the "core" tag library.
The center of JSTL is the core taglib. This can is 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 (designated, specified, determined) 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 is <c:out>. You are are free to use any prefix you like, but your must use different for each of the prefixes tag four.

Your must also put the corresponding (corresponding). tld file for each tag library in Your/web-inf directory and use the Taglib elem ENT 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 (closed, sealed, wrapped, surrounded) a group of tags within a try-catch bloc K.

The <c:out> action provides a capability (capability, performance, capacity) similar to JSP expressions such as <%= scripting-language-exp Ression%> or ${el-expression}. For example:





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

The <c:catch> action allows page authors to handle errors a uniform (uniform, same) fashion, and allows For the error handling for multiple the actions at once. <c:catch> provides page authors with granular (granularity [shape) error handling:actions that are of the to-a page Should is encapsulated (sealed) in a <c:catch>, so their exceptions'll propagate to an error page, whereas actions With secondary importance to the page should is wrapped in a <c:catch>, so they never cause the error page Mechanis M to is invoked (called). The exception thrown is stored in the scoped variable identified by VAR, which always page scope. If no exception occurred, the scoped variable identified by VAR is removed if it existed. If var is missing, the exception are simply caught and not saved.

<c:catch [var= "VarName"]>nested (nested) actions</c:catch> This section basically covers all the content of Jstl.

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

and <c:url><c:import><c:redirect>

For more information see http://java.boot.by/wcd-guide/ch09s03.html


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.