JSTL自定义Function函数标签
如:
Java代码
publicclassTestFunction{
privatestaticProductInfoManagerproductInfoManager=(ProductInfoManager)Platform.getInstance().getBean("productInfoManager");
publicstaticListgetLastDataByType(inttype,intlastSize){
returnproductInfoManager.getLastDataByType(type,lastSize);
}
publicstaticBooleanisLogin(){
Customercustomer=(Customer)ServletActionContext.getRequest().getSession().getAttribute(SessionUser.Customer_Session_User_Key);
if(nullcustomer){
returnfalse;
}
returntrue;
}
如:
Java代码 ?xmlversion="1.0"encoding="UTF-8"?
taglibxmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0"
tlib-version1.0/tlib-version
short-namemy/short-name
urihttp://www.myproject.com/my/functions/uri
function
namegetLastDataByType/name
function-classcom.myproject.app.util.TestFunction/function-class
function-signaturejava.util.ListgetLastDataByType(int,int)/function-signature
/function
function
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|