zoukankan      html  css  js  c++  java
  • JSTL 配置

    pache Tomcat安装JSTL 库步骤如下:

    从Apache的标准标签库中下载的二进包(jakarta-taglibs-standard-current.zip)。

    下载jakarta-taglibs-standard-1.1.2.zip 包并解压,将jakarta-taglibs-standard-1.1.2/lib/下的两个jar文件:standard.jar和jstl.jar文件拷贝到/WEB-INF/lib/下。

    接下来我们在 web.xml 文件中添加以下配置:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 
        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-app_2_4.xsd">
    	<jsp-config>
    	<taglib>
    	<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
    	<taglib-location>/WEB-INF/fmt.tld</taglib-location>
    	</taglib>
    	<taglib>
    	<taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
    	<taglib-location>/WEB-INF/fmt-rt.tld</taglib-location>
    	</taglib>
    	<taglib>
    	<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    	<taglib-location>/WEB-INF/c.tld</taglib-location>
    	</taglib>
    	<taglib>
    	<taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
    	<taglib-location>/WEB-INF/c-rt.tld</taglib-location>
    	</taglib>
    	<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.sun.com/jstl/sql-rt</taglib-uri>
    	<taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
    	</taglib>
    	<taglib>
    	<taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
    	<taglib-location>/WEB-INF/x.tld</taglib-location>
    	</taglib>
    	<taglib>
    	<taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
    	<taglib-location>/WEB-INF/x-rt.tld</taglib-location>
    	</taglib>
    	</jsp-config>
    </web-app>

    使用任何库,你必须在每个JSP文件中的头部包含<taglib>标签。


    核心标签

    核心标签是最常用的JSTL标签。引用核心标签库的语法如下:

    <%@ taglib prefix="c" 
               uri="http://java.sun.com/jsp/jstl/core" %>

  • 相关阅读:
    UVa 10118 记忆化搜索 Free Candies
    CodeForces 568B DP Symmetric and Transitive
    UVa 11695 树的直径 Flight Planning
    UVa 10934 DP Dropping water balloons
    CodeForces 543D 树形DP Road Improvement
    CodeForces 570E DP Pig and Palindromes
    HDU 5396 区间DP 数学 Expression
    HDU 5402 模拟 构造 Travelling Salesman Problem
    HDU 5399 数学 Too Simple
    CodeForces 567F DP Mausoleum
  • 原文地址:https://www.cnblogs.com/ouyangping/p/6361724.html
Copyright © 2011-2022 走看看