extremecomponents-1.0.1.jar 的使用小例子

第一步:先下載 需要用到的源碼http://download.csdn.net/detail/wangliutao1/5776843

              下載完成後,解壓文件

第二部: 1創建一個新 java 的 web project  項目  名稱爲 mytest

                 2將解壓文件 lib 中的 jar包導入項目  /WEB-INF/lib 目錄下 ,

                 3接着將 解壓文件中 \dist 目錄下的 extremecomponents-1.0.1.jar 導入 /WEB-INF/lib中

                 4將 \test 目錄下的test.jsp 文件放到   WebRoot


第三部:修改配置文件web .xml

web .xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<!--ExtremeTable 表格標籤的 Properties文件-->
	<context-param>
		<param-name>extremecomponentsPreferencesLocation</param-name>
		<param-value>/META-INF/extremetable.properties</param-value>
	</context-param>

</web-app>

第4部 :extremetable.properties 將配置文件放在  在項目中創建一個source folder 目錄 然後創建一個文件夾    /META-INF 目錄下。 extremetable.properties代碼如下

extremetable.properties

table.imagePath=/mytest/images/table/compact/*.gif
table.autoIncludeParameters=true
table.border=0
table.cellpadding=0
table.cellspacing=0
table.exportable=true
table.filterable=false
table.filterRowsCallback.default=org.extremecomponents.table.callback.ProcessRowsCallback
table.filterRowsCallback.limit=org.extremecomponents.table.callback.LimitCallback
table.headerClass=tableHeader
table.headerSortClass=tableHeaderSort
table.intercept.default=org.extremecomponents.table.intercept.DefaultIntercept
table.maxRowsDisplayed=50
table.medianRowsDisplayed=30
table.method=post
table.retrieveRowsCallback.default=org.extremecomponents.table.callback.ProcessRowsCallback
table.retrieveRowsCallback.limit=org.extremecomponents.table.callback.LimitCallback
table.rowsDisplayed=10
table.showExports=true
table.showPagination=true
table.showStatusBar=true
table.showTooltips=true
table.sortable=false
table.sortRowsCallback.default=org.extremecomponents.table.callback.ProcessRowsCallback
table.sortRowsCallback.limit=org.extremecomponents.table.callback.LimitCallback
table.state.default=org.extremecomponents.table.state.DefaultState
table.state.notifyToDefault=org.extremecomponents.table.state.NotifyToDefaultState
table.state.persist=org.extremecomponents.table.state.PersistState
table.state.notifyToPersist=org.extremecomponents.table.state.NotifyToPersistState
table.stateAttr=notifyState
table.styleClass=tableRegion
table.theme=eXtremeTable
table.useSessionFilterSortParam=useSessionFilterSort
table.view.compact=org.extremecomponents.table.view.CompactView
table.view.limit=org.extremecomponents.table.view.LimitView
table.view.html=org.extremecomponents.table.view.CompactView
table.width=100%
table.locale=zh_CN

row.highlightClass=highlight
row.highlightRow=true
row.intercept.default=org.extremecomponents.table.intercept.DefaultIntercept

column.calc.total=org.extremecomponents.table.calc.TotalCalc
column.calc.average=org.extremecomponents.table.calc.AverageCalc
column.cell.currency=org.extremecomponents.table.cell.NumberCell
column.cell.number=org.extremecomponents.table.cell.NumberCell
column.cell.date=org.extremecomponents.table.cell.DateCell
column.format.date=yyyy-MM-dd
column.format.datetime=yyyy-MM-dd HH:mm:ss
column.format.currency=\#\#\#,\#\#\#,\#\#\#,\#\#\#,\#00.00  
column.cell.display=org.extremecomponents.table.cell.DisplayCell
column.cell.rowCount=org.extremecomponents.table.cell.RowCountCell
column.cell.tree=org.extremecomponents.tree.TreeCell
column.escapeAutoFormat=false
column.filterCell.droplist=org.extremecomponents.table.cell.FilterDroplistCell
column.filterCell.filter=org.extremecomponents.table.cell.FilterCell
column.headerCell.header=org.extremecomponents.table.cell.HeaderCell
column.intercept.default=org.extremecomponents.table.intercept.DefaultIntercept

export.intercept.default=org.extremecomponents.table.intercept.DefaultIntercept
export.view.pdf=org.extremecomponents.table.view.PdfView
export.view.xls=org.extremecomponents.table.view.XlsView
export.view.csv=org.extremecomponents.table.view.CsvView
export.viewResolver.pdf=org.extremecomponents.table.filter.PdfViewResolver
export.viewResolver.xls=org.extremecomponents.table.filter.XlsViewResolver
export.viewResolver.csv=org.extremecomponents.table.filter.CsvViewResolver

defaultCalcLayout=multiRowCalcResults


column.filterCell.droplistDeprecated=org.extremecomponents.table.cell.FilterDroplistCell
column.filterCell.filterDeprecated=org.extremecomponents.table.cell.FilterCell
column.headerCell.headerDeprecated=org.extremecomponents.table.cell.HeaderCell
table.view.htmlDeprecated=org.extremecomponents.table.view.HtmlView

第五步:將解壓文件夾中images 文件放到 webRoot根目錄下

第六步:修改test.jsp文件

<ec:table 
		items="pres"
		action="${pageContext.request.contextPath}/test.jsp"
		imagePath="${pageContext.request.contextPath}/images/table/*.gif"
		title="Presidents"
		width="60%"
		rowsDisplayed="5"
		>


    <ec:table 
        items="pres"
        action="${pageContext.request.contextPath}/test.jsp"
        retrieveRowsCallback="limit" filterRowsCallback="limit" sortRowsCallback="limit" rowsDisplayed="5"
        >


在頁面的頂端 添加 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 這句代碼是防止亂碼,設置jsp的編碼格式

並將代碼
<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
修改爲

<%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
 如果你的servlet容器支持JSP 1.2 (或更高版本),它將能夠自動發現TLD文件,那麼你什麼也不需要做。 當extremecomponents.jar被容器加載的時候,
在它的META-INF目錄下的extremecomponents.tld文件將被找到。 這時,你需要向下面一樣在你的JSP裏把eXtremeTable包含進來:  

我們測試一下 測試路徑爲 http://127.0.0.1:8080/mytest/test.jsp我們會看到看到這個頁面就表示我們 成功了。
更多的學習信息,可以通過 http://blog.csdn.net/wangliutao1/article/details/9358845 進行學習。本文是通過這個轉載的文檔進行總結學習。如果有什麼不足,大家可以提出來一起進行討論學習。 並希望這個對大家有所幫助。



















發佈了16 篇原創文章 · 獲贊 26 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章