Javaweb Basic (_el) Library of functions

Source: Internet
Author: User
Tags tld truncated

Introduction of the El Function library

Because the displayed string is often required to be processed when displaying data in a JSP page, the Sun company PIN defines a set of El Libraries for developers to use for some common processing.
These El functions are described in the Jstl development package, so using the Sun Company's El Library in a JSP page requires importing the JSTL development package and importing the El function library into the page as follows:

MyEclipse comes with the JSTL Development Kit:

  

Fn.tld is the corresponding TLD description file for the El function library, as shown in:

  
El functions defined in the page using Jstl:<% @taglib uri= "http://java.sun.com/jsp/jstl/functions" prefix= "FN"%>

Example of use of the El function
  1 <%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%> 2 <% @page import= "Me.gacl.domain.User" %> 3 <%--introduced El Library--%> 4 <% @taglib uri= "http://java.sun.com/jsp/jstl/functions" prefix= "FN"%> 5 <!    DOCTYPE html> 6 

The code for the Me.gacl.domain.User class used in the JSP page is as follows:

1 package me.gacl.domain; 2  3 public class User {4      5     /** 6      * Hobbies 7 */      8     private string likes[]; 9     public     string [] Getlikes () {One         return likes;12     }13, public     void Setlikes (string[] likes) {This.likes         = Likes ;     }17}

The results of the operation are as follows:

  

Javaweb Basic (_el) Library of functions

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.