码迷,mamicode.com
首页 > 其他好文 > 详细

自定义fns

时间:2018-08-25 14:24:40      阅读:829      评论:0      收藏:0      [点我收藏+]

标签:j2ee   span   str   jee   jeesite   font   function   tag   signature   

(1)函数申明(jsp页面声明)

<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>

(2)fns.tld文件

<?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 http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"

  version="2.0">

   

  <description>JSTL 1.1 functions library</description>

  <display-name>JSTL functions sys</display-name>

  <tlib-version>1.1</tlib-version>

  <short-name>fns</short-name>

  <uri>http://java.sun.com/jsp/jstl/functionss</uri>

 

  <function>

    <description>获取管理路径</description>

    <name>getAdminPath</name>

    <function-class>com.thinkgem.jeesite.common.config.Global</function-class>

    <function-signature>java.lang.String getAdminPath()</function-signature>

    <example>${fns:getAdminPath()}</example>

  </function>

  <function>

    <description>获取网站路径</description>

    <name>getFrontPath</name>

    <function-class>com.thinkgem.jeesite.common.config.Global</function-class>

    <function-signature>java.lang.String getFrontPath()</function-signature>

    <example>${fns:getFrontPath()}</example>

  </function>

  <function>

    <description>获取网站URL后缀</description>

    <name>getUrlSuffix</name>

    <function-class>com.thinkgem.jeesite.common.config.Global</function-class>

    <function-signature>java.lang.String getUrlSuffix()</function-signature>

    <example>${fns:getUrlSuffix()}</example>

  </function>

  <function>

    <description>获取配置</description>

    <name>getConfig</name>

    <function-class>com.thinkgem.jeesite.common.config.Global</function-class>

    <function-signature>java.lang.String getConfig(java.lang.String)</function-signature>

    <example>${fns:getConfig(key)}</example>

  </function>

</taglib>

(3)jsp页面直接引用

${fns:getUrlSuffix}

${fns:getConfig(key)}

 

自定义fns

标签:j2ee   span   str   jee   jeesite   font   function   tag   signature   

原文地址:https://www.cnblogs.com/yehuili/p/9533017.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!