将extremecomponents.jar文件拷贝到你的工程的/WEB-INF/lib目录下。
处理TLD文件有两种方式。 你可以把extremecomponents.tld文件放到WEB-INF目录下的任何地方。 不过,为了便于管理,我喜欢把我的TLD文件都放到/WEB-INF/tld目录下。你需要根据你的extremecomponents.tld 文件的位置来修改/WEB-INF/web.xml文件的标签映射。
/tld/extremecomponents/WEB-INF/tld/extremecomponents.tld随后,你需要向下面一样在你的JSP里把eXtremeTable包含进来:<%@ taglib uri="/tld/extremecomponents" prefix=“ec” %>
如果你的servlet容器支持JSP 1.2 (或更高版本),它将能够自动发现TLD文件,那么你什么也不需要做。 当extremecomponents.jar被容器加载的时候,在它的META-INF目录下的extremecomponents.tld文件将被找到。 这时,你需要向下面一样在你的JSP里把eXtremeTable包含进来:
<%@ taglib uri=“http://www.extremecomponents.org” prefix=“ec” %>
为了使用eXtremeTable样式,从styles目录拷贝extremecomponents.css到你存放.css脚本的地方。 当然在JSP页面里,你需要提供一个到CSS的链接。就像我将我的样式表放在/styles目录下。
<%@ taglib uri="/tld/c" prefix=“c” %>
为了使导出功能有效,你需要设置导出过滤器。这是一个仅用于导出功能的可选配置。
如下所示在/WEB-INF/web.xml里配置过滤器:
eXtremeExportorg.extremecomponents.table.filter.ExportFiltereXtremeExport/*过滤器还有一个可选的初始化参数,用于决定什么时候生成报头(headers)。我发现大多数的servlet容器 倾向于在调用过滤器的doFilter()方法后才设置响应报头(response headers)。然而,一些servlet容器只有在 调用过滤器的doFilter()方法前设置响应报头,过滤器才能正常工作。默认的方法是调用过滤器的doFilter()方法后 设置响应报头,你可以通过使用responseHeadersSetBeforeDoFilter这个初始化参数调整它。eXtremeExportorg.extremecomponents.table.filter.ExportFilterresponseHeadersSetBeforeDoFiltertrue如果你使用了Sitemesh,你将需要包含SitemeshPageFilter。SitemeshPageFilter扩展了正常的 sitemesh的PageFilter,它使得正在进行导出的JSP页面不被修饰。如下所示在/WEB-INF/web.xml里配置过滤器:
Sitemeshorg.extremecomponents.table.filter.SitemeshPageF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