zoukankan      html  css  js  c++  java
  • JSP开发中对jstl的引用方式(标签库引用)

    创建标签库引用文件taglibs.inc

    一 采用本地标签库的taglibs.inc文件
    <%--struts库标签 --%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-menu.tld" prefix="menu" %>
    <%--struts menu库标签 --%>
    <%@ taglib uri="/WEB-INF/struts-menu-el.tld" prefix="menu-el" %>
    <%@ taglib uri="/WEB-INF/pager-taglib.tld" prefix="pg"%>
    <%--JSTL库标签 --%>
    <%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
    <%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %>
    <%@ taglib uri="/WEB-INF/sql.tld" prefix="sql" %>
    <%@ taglib uri = "/WEB-INF/fn.tld" prefix = "fn"%>
    二 采用远程标签库的taglibs.inc文件
    <%--struts库标签 --%>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
    <%--struts menu库标签 --%>
    <%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu"%>
    <%@ taglib uri="http://struts-menu.sf.net/tag-el" prefix="menu-el"%>
    <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
    <%--JSTL库标签 --%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
    <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
    <%@ taglib uri="http://java.sun.com/jstl/function" prefix="fn"%>
    最后 在jsp文件中引用taglibs.inc文件
    <%@ >page language="java" pageEncoding="gb2312"%
    <%@ >include file="/common/taglibs.inc"%

    在web.xml配置文件中的<web-app>节点下增加下面的配置信息

        <jsp-config>
           <!--       struts的HTML标签 -->
           <taglib>
               <taglib-uri>http://struts.apache.org/tags-html</taglib-uri>
               <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
           </taglib>
          
           <!--       struts 的逻辑标签(logic)-->
           <taglib>
               <taglib-uri>http://struts.apache.org/tags-logic</taglib-uri>
               <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
           </taglib>
           <!--       Struts 的Bean标签-->
           <taglib>
               <taglib-uri>http://struts.apache.org/tags-bean</taglib-uri>
               <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
           </taglib>
           <!--       JSTL标签-->
           <taglib>
               <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
               <taglib-location>/WEB-INF/c.tld</taglib-location>
           </taglib>
           <!--       page标签-->
           <taglib>
               <taglib-uri>http://jsptags.com/tags/navigation/pager</taglib-uri>
               <taglib-location>/WEB-INF/pager-taglib.tld</taglib-location>
           </taglib>
          
          
           <!--       struts menu标签-->
           <taglib>
               <taglib-uri>http://struts-menu.sf.net/tag</taglib-uri>
               <taglib-location>/WEB-INF/struts-menu.tld</taglib-location>
           </taglib>
           <!--       struts menu的EL标签-->
           <taglib>
               <taglib-uri>http://struts-menu.sf.net/tag-el</taglib-uri>
               <taglib-location>/WEB-INF/struts-menu-el.tld</taglib-location>
           </taglib>
           <!--       JSTL的fmt标签-->
           <taglib>
               <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
               <taglib-location>/WEB-INF/fmt.tld</taglib-location>
           </taglib>
           <!--       JSTL的SQL标签-->
           <taglib>
               <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
               <taglib-location>/WEB-INF/sql.tld</taglib-location>
           </taglib>
           <taglib>
               <taglib-uri>http://java.su.com/jstl/function</taglib-uri>
               <taglib-location>/WEB-INF/fn.tld</taglib-location>
           </taglib>
          
        </jsp-config>
  • 相关阅读:
    C# WinForm开发系列 Socket/WCF/Rometing/Web Services
    .net(c#) 简单的软件注册功能的实现:
    来自xici网友的Ubuntu和windows xp的Super PI性能测试
    最新的Linpack测试指南-基于woodcrest机器
    CFX x86_64 version issues 无法找到可执行文件
    如何检查一个mvapich的版本?
    Intel Tools Training Notes Intel Compiler, MKLs
    Infiniband IPoIB Debug FAQ
    让CFX的license server在开机的时候就自动启动
    FFTW 3.1.2 和 2.1.5编译
  • 原文地址:https://www.cnblogs.com/huaxingtianxia/p/5600267.html
Copyright © 2011-2022 走看看