Prerequisites for jstl Practice 1

Source: Internet
Author: User

When using the project, the MVC structure is used in the view layer jstl, which is very useful. Summarize the usage experience

In jstl1.0, due to lack of functions libraries, it is not very practical. For example, simple substring and trim must be completed using Java. In Version 1.1, this library is added and El expressions are added, this eliminates the hassle of <C: out, so this article discusses jstl1.1

I. servlet 2.4 is required

This is the easiest place for many new users to make mistakes. Check your web. XML to see if there are any of the following words:

< Web-app ID = "Webapp_id" Version = "2.4" Xmlns = "Http://java.sun.com/xml/ns/j2ee"
Xmlns: xsi
= "Http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemalocation
= "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >

Even if jstl is not used, we strongly recommend that you use the servlet2.4 specification.
If the servlet specification is not 2.4, the El expression below is not supported.
${1 + 2 + 3}
Must be written
<C: Out value = '$ {1 + 2 + 3}'/>

2. JDK 1.4.2 or later is recommended.In this way, you can load a lot of second-party component packages.
With jdk1.4.2, you only need the following two packages. Otherwise, Google will check it out.

3. Download jstl. Jar standard. JarIf they are missing
Jstl. jar is the connector class and interface of jstl.
Standard. jar is the reference implementation (RI) of jstl. jar, developed by the Apache taglibs Project

4. reference the tag library on the JSP page
<% @ page Language = "Java" contenttype = "text/html; charset = GBK "pageencoding =" GBK "%>
<% @ taglib uri =" http://java.sun.com/jsp/jstl/core "prefix =" C "%>
<% @ taglib uri =" http://java.sun.com/jsp/jstl/fmt "prefix =" FMT "%>
<% @ taglib uri =" http://java.sun.com/jsp/jstl/functions "prefix =" FN "%>
SQL library is not needed, the XML library is rarely used. Generally, it is okay to include the preceding three labels.

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.