JSTL simplifies JSP encoding

Source: Internet
Author: User
Tags tagname

With the popularity of J2EE thin client technology JavaServer Pages (JSP) over the past few years, independent developers have created many custom JSP tag libraries. Although many tag libraries are written to achieve different goals, they often provide similar solutions for iterations, conditions, and other general operations.
To reduce the need for independent Tag libraries to solve similar general-purpose problems, JSTL (JavaServer Pages Standard Tag Library, JSP) was created under the sponsorship of Java Community Process (JSR 52) the standard tag library provides a single standard solution to address these common features.
JSTL Library
JSTL provides special support for conditional processing, iteration, internationalization, database access, and scalable Markup Language (XML) processing. JSTL also introduces expression language (EL, expression language), which greatly simplifies access to and operations on JSP application data. JSTL includes four JSP 1.2 custom tag libraries, each covering a specific functional area.
The Core tag library provides general support for routine tasks, such as displaying and setting variables, reusing a set of projects, test conditions, and other operations (such as importing and redirecting Web content ).
The XML tag library provides support for XML processing and operations, including parsing and iteration of XML nodes, conditional evaluation based on XML data, and Extensible Style table Language conversion (Extensible Style Language Transformations, XSLT.
The Internationalization Tag library supports multilingual applications.
The Database mark Database provides standardized support for accessing and modifying Database data.
Table 1: four Mark libraries of JSTL
Functional Areas
URI
Prefix
Example
Core)
Http://java.sun.com/jstl/core
C
<C: tagname...>
XML
Http://java.sun.com/jstl/xml
X
<X: tagname...>
Internationalization)
Http://java.sun.com/jstl/fmt
Fmt
<Fmt: tagname...>
Database)
Http://java.sun.com/jstl/ SQL
SQL
<SQL: tagname...>
Getting started with JSTL
The best way to get a preliminary understanding of JSTL is to visit the Apache website --jakarta.apache.org and download the reference implementation of JSTL. You can also find detailed installation guide on the Apache site. The downloadable reference implementation is a combination of JAR files, documents, and simple code examples.
To use JSTL in your J2EE Web application, simply copy the jstl jar file under the "lib" directory to the WEB-INF/lib directory of your application. To use the JSTL tag in a specific JSP, you must also provide a taglib command. For example, to import the "core" JSTL library to your page, you should include the following commands at the top of your JSP:
Related Article

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.