/** * Class Description: * * @author yjde */ public class ELFuncUtil { /** * EL方法用于连接两个字符串 * * @param str1 * @param str2 * @return */ public static String append(String str1, String str2) { return str1 + str2; } }
<?xml version="1.0" encoding="UTF-8"?> <taglib 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 [url]http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd[/url]" version="2.0"> <tlib-version>1.0</tlib-version> <short-name>elf</short-name> <function> <description>用于连接两个字符串</description> <name>append</name> <function-class>com.ourpalm.mis.common.util.ELFuncUtil </function-class> <function-signature>java.lang.String append(java.lang.String,java.lang.String)</function-signature> <example>${elf:append(str1, str2)}</example> </function> </taglib>
<%@ taglib prefix="elf" uri="/WEB-INF/tlds/elfunc.tld"%>
<c:out value="${elf:append(param.str1, param.str2)}"/>