`

JSTL EC TABLE extremeTable 学习

阅读更多
1、何为 extremeTable,又一个开源taglib
         extremeTable,开源的jsp 自定义标签,以表格的形式显示数据,当前最新版本为 1.0.1-M1.
它是一个类似display tag,valueList 等开源产品.
homepage: http://extremecomponents.org/
download: http://sourceforge.net/projects/extremecomp/

开源产品作者:
Jeff Johnston ,现居住美国,圣路易斯.
                   六年web应用软件开发经验,eXtremeComponents最初的创建者. 负责设计及大部分的编码。

其它还包括Paul Horn ,eXtremeTree的技术设计, 以及大部分的编码;
Dave Goodin,Brad Parks等.

主要特色
1、导出EXCEL以及pdf无需再另写jsp(这个基本与valuelist作比较,因为以前用valueList的时候每写一个table都要再写一个excel.jsp)
2、扩展性比较强,基本上想怎样改就怎样改,对jar影响比较少。
3、另外据官方声称有以下四点

  • Fast ( 本人曾小测一次,三千纪录情况下,效率基本与valuelist持平)
  • Efficient
  • Easy ( 得确很容易使用与理解加扩展)
  • Reliable

    安装要求
    1、Servlet 2.3 或更高
    2、 JDK 1.3.1 或更高

    最小的Jars需求
    1、commons-beanutils 1.6
    2、commons-collections 3.0
    3、 commons-lang 2.0
    4、 commons-logging 1.0.4
    5、 standard 1.0.2

    PDF 导出要用到的包:
    1、 avalon-framework 4.0
    2、batik 1.5-fop-0.20-5
    3、 fop 0.20.5
    4、 xalan 2.5.1
    5、 xercesImpl 2.6.1
    6、 xml-apis 2.0.2
    XLS 导出要用到的包:
    1、 poi-2.5.1.jar


    2、安装与测试

    下载解压到的主要文件包括

    [1]src源文件
    [2]extremecomponents.jar以及其它所依赖的包

    [3]tld文件
    extremecomponents.tld

    [4]一组默认样式及图片
    extremecomponents.css

    [5]用以校验安装的测试页面
    test.jsp

    [6]doc文档,比较详细

    快速配置安装
    web app目录结构
    /ROOT
            /WEB-INF/web.xml
               /tld/extremecomponents.tld
                  /lib
                  /classes/extremecomponents.properties
                          [extremecomponents.properties文件可到source\org\extremecomponents\table\core\中得到]
             /images/*.jpg [一组默认样式及图片]
             /css/extremecomponents.css
             /test.jsp
             /index.jsp [用于学习以及扩展测试用代码请见下]
         

    web.xml 配置
    包括taglib uri 定义以及导出文件filter,由于只是手板功夫,这里就略过了,相关代码如下:

    <taglib>
    <taglib-uri>/tld/extremecomponents</taglib-uri>
    <taglib-location>/WEB-INF/tld/extremecomponents.tld</taglib-location>
    </taglib>

    <filter>
    <filter-name>eXtremeExport</filter-name>
    <filter-class>org.extremecomponents.table.filter.ExportFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>eXtremeExport</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>


    配置好所有后,开tomcat,测试浏览http://your_web_app/test.jsp,看到

    Congratulations!! You have successfully configured eXtremeTable!
    恭喜你,这表示安装成功!


    3、动手学习这个taglib
    建index.jsp页面,修改代码如下

    <%@ page contentType="text/html;charset=GBK"%>
    <%@ page import="java.util.*"%>
    <%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
    <!-- 在本页要用到jstl-->
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!--使用include的方式-->
    <link rel="stylesheet" type="text/css" href="<c:url value="/extremecomponents.css"/>">

    <%
           List goodss
    = new ArrayList();
        
    for (int i = 1; i <= 10; i++)
        
    {
               Map goods
    = new java.util.HashMap();
               goods.put(
    "code", "A00"+i);
               goods.put(
    "name", "面包"+i);
               goods.put(
    "status", "A:valid");
               goods.put(
    "born", new Date());
               goodss.add(goods);
           }

           request.setAttribute(
    "goodss", goodss);
    %>
    <ec:table
    collection
    ="goodss"
           action
    ="${pageContext.request.contextPath}/test.jsp"
           imagePath
    ="${pageContext.request.contextPath}/images/*.gif"
           cellpadding
    ="1"
           title
    ="my bread">
    <ec:column property="code"/>
    <ec:column property="name"/>
    <ec:column property="status"/>
    <ec:column property="born" cell="date" format="yyyy-MM-dd"/>
    </ec:table>



    效果如下:
    ec1.jpg


    [1] 1.0.1-M1 版支持国际化
    修改web.xml文件增加

    <context-param>
       
    <param-name>extremecomponentsResourceBundleLocation</param-name>
       
    <param-value>com.itorgan.tags.extreme.extremetableResourceBundle</param-value>
    </context-param>



    意指到 com.itorgan.tags.extreme 下找 extremetableResourceBundle_[language]_[country].properties 文件

    extremetableResourceBundle_en_US.properties代码如下
    table.statusbar.resultsFound={0} results found, displaying {1} to {2}
    table.statusbar.noResultsFound=There were no results found.
    table.toolbar.showAll=Show All

    extremetableResourceBundle_zh_CN.properties如下.
    table.statusbar.resultsFound={0} \u6761\u7EAA\u5F55\u7B26\u5408\u6761\u4EF6, \u73B0\u5728\u662F\u7B2C {1} \u81F3 {2} \u6761\u7EAA\u5F55
    table.statusbar.noResultsFound=\u6CA1\u6709\u8981\u67E5\u8BE2\u7684\u7EAA\u5F55\u3002
    table.toolbar.showAll=\u6240 \u6709

    补充:中文 - > Unicode编码 可通过反编译class文件或用native2ascii命令得到 。

    然后在table标签中增加locale属性即可切换

    <ec:table
           ………………
           ………………
           ………………
           locale
    ="en_US"
    >

    <ec:table
           ………………
           ………………
           ………………
           locale
    ="zh_CN"
    >

  • 1、何为 extremeTable,又一个开源taglib
    extremeTable,开源的jsp 自定义标签,以表格的形式显示数据,当前最新版本为 1.0.1-M1.
    它是一个类似display tag,valueList 等开源产品.
    homepage: http://extremecomponents.org/
    download: http://sourceforge.net/projects/extremecomp/

    开源产品作者:
    Jeff Johnston ,现居住美国,圣路易斯.
    六年web应用软件开发经验,eXtremeComponents最初的创建者. 负责设计及大部分的编码。
    其它还包括Paul Horn ,eXtremeTree的技术设计, 以及大部分的编码;
    Dave Goodin,Brad Parks等.

    主要特色
    1、导出EXCEL以及pdf无需再另写jsp(这个基本与valuelist作比较,因为以前用valueList的时候每写一个table都要再写一个excel.jsp)
    2、扩展性比较强,基本上想怎样改就怎样改,对jar影响比较少。
    3、另外据官方声称有以下四点

    Fast ( 本人曾小测一次,三千纪录情况下,效率基本与valuelist持平)
    Efficient
    Easy ( 得确很容易使用与理解加扩展)
    Reliable

    安装要求
    1、Servlet 2.3 或更高
    2、 JDK 1.3.1 或更高
    最小的Jars需求
    1、commons-beanutils 1.6
    2、commons-collections 3.0
    3、 commons-lang 2.0
    4、 commons-logging 1.0.4
    5、 standard 1.0.2

    PDF 导出要用到的包:
    1、 avalon-framework 4.0
    2、batik 1.5-fop-0.20-5
    3、 fop 0.20.5
    4、 xalan 2.5.1
    5、 xercesImpl 2.6.1
    6、 xml-apis 2.0.2
    XLS 导出要用到的包:
    1、 poi-2.5.1.jar


    2、安装与测试

    下载解压到的主要文件包括

    [1]src源文件
    [2]extremecomponents.jar以及其它所依赖的包

    [3]tld文件
    extremecomponents.tld

    [4]一组默认样式及图片
    extremecomponents.css

    [5]用以校验安装的测试页面
    test.jsp

    [6]doc文档,比较详细

    快速配置安装
    web app目录结构
    /ROOT
      /WEB-INF/web.xml
     /tld/extremecomponents.tld
    /lib
    /classes/extremecomponents.properties
    [extremecomponents.properties文件可到source\org\extremecomponents\table\core\中得到]
     /images/*.jpg [一组默认样式及图片]
     /css/extremecomponents.css
     /test.jsp
     /index.jsp [用于学习以及扩展测试用代码请见下]


    web.xml 配置
    包括taglib uri 定义以及导出文件filter,由于只是手板功夫,这里就略过了,相关代码如下:

    <taglib>
    <taglib-uri>/tld/extremecomponents</taglib-uri>
    <taglib-location>/WEB-INF/tld/extremecomponents.tld</taglib-location>
    </taglib>
    <filter>
    <filter-name>eXtremeExport</filter-name>
    <filter-class>org.extremecomponents.table.filter.ExportFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>eXtremeExport</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>


    配置好所有后,开tomcat,测试浏览http://your_web_app/test.jsp,看到

    Congratulations!! You have successfully configured eXtremeTable!
    恭喜你,这表示安装成功!


    3、动手学习这个taglib
    建index.jsp页面,修改代码如下

    <%@ page contentType="text/html;charset=GBK"%>
    <%@ page import="java.util.*"%>
    <%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
    <!-- 在本页要用到jstl-->
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!--使用include的方式-->
    <link rel="stylesheet" type="text/css" href="<c:url value="/extremecomponents.css"/>">

    <%
    List goodss = new ArrayList();
    for (int i = 1; i <= 10; i++)
    {
    Map goods = new java.util.HashMap();
    goods.put("code", "A00"+i);
    goods.put("name", "面包"+i);
    goods.put("status", "A:valid");
    goods.put("born", new Date());
    goodss.add(goods);
    }
    request.setAttribute("goodss", goodss);
    %>
    <ec:table
    collection="goodss"
    action="${pageContext.request.contextPath}/test.jsp"
    imagePath="${pageContext.request.contextPath}/images/*.gif"
    cellpadding="1"
    title="my bread">
    <ec:column property="code"/>
    <ec:column property="name"/>
    <ec:column property="status"/>
    <ec:column property="born" cell="date" format="yyyy-MM-dd"/>
    </ec:table>


    效果如下:



    [1] 1.0.1-M1 版支持国际化
    修改web.xml文件增加

    <context-param>
    <param-name>extremecomponentsResourceBundleLocation</param-name>
    <param-value>com.itorgan.tags.extreme.extremetableResourceBundle</param-value>
    </context-param>


    意指到 com.itorgan.tags.extreme 下找 extremetableResourceBundle_[language]_[country].properties 文件

    extremetableResourceBundle_en_US.properties代码如下
    table.statusbar.resultsFound={0} results found, displaying {1} to {2}
    table.statusbar.noResultsFound=There were no results found.
    table.toolbar.showAll=Show All

    extremetableResourceBundle_zh_CN.properties如下.
    table.statusbar.resultsFound={0} \u6761\u7EAA\u5F55\u7B26\u5408\u6761\u4EF6, \u73B0\u5728\u662F\u7B2C {1} \u81F3 {2} \u6761\u7EAA\u5F55
    table.statusbar.noResultsFound=\u6CA1\u6709\u8981\u67E5\u8BE2\u7684\u7EAA\u5F55\u3002
    table.toolbar.showAll=\u6240 \u6709

    补充:中文 - > Unicode编码 可通过反编译class文件或用native2ascii命令得到 。

    然后在table标签中增加locale属性即可切换

    <ec:table
    ………………
    ………………
    ………………
    locale="en_US"
    >

    <ec:table
    ………………
    ………………
    ………………
    locale="zh_CN"
    >



     

    分享到:
    评论
    1 楼 y_715 2011-09-24  
    document.getElementById("ec").locale ="en_US"  这样赋值可以不可啊

    相关推荐

      JSTL和EL的学习

      JSTL(JavaServer Pages Standard Tag Library)和EL(Expression Language)是Java Web开发中用于增强JSP页面可读性和可维护性的两个重要组件。JSTL是一套标准的标签库,提供了各种功能,如迭代、条件判断、XML处理等,...

      jstl练习实例,学习JSTL

      本篇将详细讲解JSTL的基本概念、核心组件以及通过"jstl练习实例"进行的学习要点。 一、JSTL简介 JSTL是由Apache软件基金会的Jakarta项目维护的一个开源库,它提供了多种预定义的标签,用于处理常见的JSP任务,如...

      jstl源码jstl学习

      **JSTL的学习路径:** 1. **了解核心标签**:包括`&lt;c:if&gt;`, `&lt;c:choose&gt;`, `&lt;c:when&gt;`, `&lt;c:otherwise&gt;`, `&lt;c:forEach&gt;`, `&lt;c:forTokens&gt;`等,它们分别对应条件判断和循环控制。 2. **掌握EL表达式**:EL...

      jstl学习大全,jstl源码,很全的jstl学习代码

      **JSTL(JavaServer Pages Standard Tag Library)学习大全** JSTL是JavaWeb开发中的一个强大工具,它提供了一套标准的标签库,用于简化HTML或XML页面上的JavaServer Pages(JSP)代码。本资源集合包含了丰富的JSTL...

      jstl标签学习笔记

      **JSTL标签详解** JavaServer Pages Standard Tag Library (JSTL) 是一套标准的标签库,用于简化JSP页面的编程,使得开发者能够使用标签而不是脚本来处理常见任务。在JSTL中,`EL(Expression Language)`是用于...

      JSTL学习

      ### JSTL(JavaServer Pages Standard Tag Library)深入解析 #### 一、JSTL的起源与重要性 JSTL,即JavaServer Pages Standard Tag Library,是在2002年由Sun Microsystems制定的一系列标准标签库,旨在为JSP...

      jstl总结资料自己的学习笔记

      **JSTL(JavaServer Pages Standard Tag Library)详解** JSTL是JavaServer Pages标准标签库,它提供了一组预定义的标签,用于简化JSP页面的开发,使其更加结构化,可读性更强,同时也提高了代码的复用性和可维护性...

      jstl文档学习资料

      jstl文档学习jstl文档学习jstl文档学习

      JSTL参考资料+学习笔记

      **JSTL(JavaServer Pages Standard Tag Library)**是Java Web开发中的一种标准标签库,它为JSP...JSTL的学习笔记对于Java开发爱好者来说是一份宝贵的参考资料,可以帮助他们快速掌握JSTL的用法并应用于实际项目中。

      jstl-1.2.jar免费下载

      jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2...

      java jstl学习详解过程

      ### Java JSTL 学习详解过程 #### JSTL简介 JSTL(JavaServer Pages Standard Tag Library,JavaServer Pages 标准标签库)是一组由 Sun Microsystems 提供的标准标签库,它允许开发者在 JSP 页面中使用预定义的...

      jstl-1.2.1 jar

      jstl-1.2.1,之前的版本需要在服务器中配置一下,而且它分成了两个jar(jstl.jar和standard.jar)还有一个tld文件,而1.2已经不用配置了,直接把javax.servlet.jsp.jstl-1.2.1.jar和javax.servlet.jsp.jstl-api-1.2.1...

      JSTL.rar_JSTL_JSTL下载

      **JSTL(JavaServer Pages Standard Tag Library)详解** JSTL,全称为JavaServer Pages Standard Tag Library,是Java EE...通过学习和掌握JSTL,开发者可以更好地驾驭JSP页面,构建出更加高效、易维护的Web应用。

      JSTL深入详解,JSTL学习文档

      **JSTL(JavaServer Pages Standard Tag Library)深入详解** JSTL,全称为JavaServer Pages Standard Tag ...提供的"JSTL详解.CHM"文件将涵盖JSTL的详细使用方法、示例和最佳实践,是学习和精通JSTL的重要参考资料。

      jstl1.1和jstl1.0

      **JSTL1.1与JSTL1.0详解** JavaServer Pages Standard Tag Library (JSTL) 是一个用于简化JavaServer Pages (JSP) 开发的标签库,它提供了一系列预定义的标签,帮助开发者处理常见的任务,如迭代、条件判断、XML...

      JSTL标准标签库学习(简单).pdf

      ### JSTL标准标签库详解 #### 一、简介 ##### 1、JSTL是什么? JSTL,全称JSP Standard Tag Library,即JSP标准标签库,是由Sun Microsystems(现已被Oracle收购)根据特定规范开发的一系列可重用的标签库,用于...

      jstl学习源码

      **JSTL(JavaServer Pages Standard Tag Library)学习源码** JSTL 是一套用于 JavaServer Pages (JSP) 的标准标签库,它提供了一系列标签来简化 JSP 页面的编程,使得开发者能够更加关注页面逻辑而不是底层的 Java...

      JSTL中文帮助文档

      **JSTL(JavaServer Pages Standard Tag Library)中文帮助文档** JSTL 是一套用于 JavaServer Pages (JSP) 的标准标签库,...学习和使用 JSTL,能让你的 JSP 页面更专业、更易于维护,是 J2EE 开发者必备的一项技能。

      JSTL标签JSTL标签

      **JSTL(JavaServer Pages Standard Tag Library)标签库**是Java Web开发中的一个重要组成部分,它为JavaServer Pages(JSP)提供了一套标准的标签,用于简化网页开发,提高代码的可读性和可维护性。JSTL的出现是...

    Global site tag (gtag.js) - Google Analytics