MyELFunction.java
自定义一个连接两个字符串的函数
public class MyELFunction {
public static String concat(String str1,String str2){
return str1+str2;
}
}
myTag.tld
<!-- 描述EL自定义函数 -->
<function>
<name>concat</name>
<function-class>cn.stud.wlc.El.MyELFunction</function-class>
<function-signature>java.lang.String concat(java.lang.String,java.lang.String)</function-signature>
</function>
TestEL.jsp
<!--测试链接 http://localhost:8080/vip/EL/TestEL.jsp?name1=qqq&name2=eee -->
${wlc:concat(param.name1,param.name2)}