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