有没有file-new类似这样方便的方法,我不太懂,这些,感谢请教一下。

解决方案 »

  1.   

    1.设置一个包里面写类com.hisys.tally.presentation.tags.ShipTallyFunction定义方法
    EG. 
    public static String getShift(int s) {
    String temp = "";
    if (s == 2) temp = "中班";
    if (s == 0) temp = "夜班";
    if (s == 1) temp = "白班";
    return temp;
    }
    2.然后再在JSP配置文件包WEB-INF里写配置文件xxx.tld把方法与标签名一一对应
    <function>
       <description>getShift</description>
       <name>getShift</name>
    <function-class>com.hisys.tally.presentation.tags.ShipTallyFunction</function-class>
    <function-signature>java.lang.String getShift(int)</function-signature>
      </function> 
    3. WEB.XML文件里面配置TAG
    <jsp-config>    
    <taglib>
        <taglib-uri>
           http://java.sun.com/jsp/jstl/core
        </taglib-uri>
        <taglib-location>
           /WEB-INF/c.tld
        </taglib-location>
    </taglib>   
    <taglib>
        <taglib-uri>
           http://java.sun.com/jsp/jstl/fmt
        </taglib-uri>
        <taglib-location>
           /WEB-INF/fmt.tld
        </taglib-location>
    </taglib>   
    <taglib>
        <taglib-uri>
           http://java.sun.com/jsp/jstl/fn
        </taglib-uri>
        <taglib-location>
           /WEB-INF/fn.tld
        </taglib-location>
    </taglib>   
    <taglib>
        <taglib-uri>
           http://struts.apache.org/tags-html
        </taglib-uri>
        <taglib-location>
           /WEB-INF/struts-html.tld
        </taglib-location>
    </taglib>   
    <taglib>
        <taglib-uri>
           http://hisys.com.cn/tags-app
        </taglib-uri>
        <taglib-location>
           /WEB-INF/app.tld
        </taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>
           http://hisys.com.cn/tally
        </taglib-uri>
        <taglib-location>
           /WEB-INF/xxx.tld
        </taglib-location>
    </taglib>

        </jsp-config>