JSP standard template library (jstl)

Source: Internet
Author: User
Tags microsoft frontpage
The JSP standard template library (jstl) is a new component developed for JSP by Sun. Jstl allows you to use tags for JSP page development, instead of using most JSP Program Scriptlet Code Development. Jstl can do almost anything that traditional JSP scriptlet code can do. You may wonder why we need another HTML language? STL allows JSP programmers to use tags instead of Java code for programming. The following example shows why this is superior. We will check a very simple JSP page from 1 to 10. We will check through two methods: one is JSP-based scriptlet and the other is jstl. When the example of this counter page is written using JSP scriptlet, the JSP page is as follows: <HTML> Source code Will contain a mix of HTML tags and Java statements. This hybrid programming method is not the best, mainly because of the following reasons. The main reason is its readability. This readability mainly depends on humans and computers. Jstl allows programmers to view a page that only contains complete HTML and HTML-like tags. The readability of SP scriptlet code is not suitable for humans. This kind of mixed scriptlet and HTML code is also hard for computers to read. Especially for official html tools such as Dreamweaver and Microsoft FrontPage, these tools are more intuitive. Currently, most official html tools isolate JSP scriptlet code in the form of non-editable blocks. This official HTML tool cannot directly modify the JSP scriptlet code. The following code shows how to use jstl to compile this counter example. As you can see, this code list is immutable and only one label is used. HTML and jstl labels are mixed to generate this program. <% @ Taglib uri = "http://java.sun.com/jstl/core" prefix = "C" %> <HTML>
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.