web.xml配置显示标记

时间:2013-03-04 12:28:24

标签: java jsp jsp-tags displaytag

如何在jsp项目中配置显示标记?

WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException

2 个答案:

答案 0 :(得分:0)

对于显示标记,web.xml中不需要任何配置

display tag用于网格数据中的分页排序

只放了三个jar(1)displaytag-1.2,(2)displaytag-export-poi-1.2,(3)displaytag-portlet-1.2

并在jsp页面中编写标签lib,如:

   <%@ taglib uri="http://displaytag.sf.net" prefix="display"%>    

你的代码:

        <display:table name="sessionScope.yourListname" pagesize="5" sort="list" cellspacing="10" cellpadding="5">

            <display:column property="var1" title="Title1" sortable="true" />  
            <display:column property="var2" title="Title2" sortable="true" />  
            <display:column property="var3" title="Title3" sortable="true"  />  

        </display:table> 

了解更多信息请点击链接

http://viralpatel.net/blogs/struts-displaytag-tutorial-sort-pagination-data-displaytag-struts/

答案 1 :(得分:0)

示例Jsp页面:

<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>


<display:table uid="ratingAdjustmentHistoryUID" name="${ratingAdjustmentHistoryForm.ratingAdjustmentHistoryQOList}"
                            requestURI="/ratingAdjustmentHistoryPre.do?method=searchRatingTracker" excludedParams="method"
                            decorator="com.ford.mpl.superg.decorator.RatingAdjustmentHistoryTableDecorator" keepStatus="true" style="width:100%">
                            <%@include file="/jsp/include/displaytag.jsp"%>
                                <display:column property="shipSite" title="RAHSiteCode" sortable="true" />
                                <display:column property="ratingMonth" title="RAHRatingMonth" sortable="true" />
                                <display:column property="prior" title="RAHPrior" sortable="true" />
                                <display:column property="revised" title="RAHRevised" sortable="true" />
                                <display:column property="adjustments" title="RAHAdjustments" sortable="true" />
                                <display:column property="comments" title="RAHComments" sortable="true" />
                                <display:column property="lastUpdated" title="RAHLastUpdated" sortable="true" />
                                <display:column property="lastUpdatedCDSID" title="RAHLastUpdatedCDSID" sortable="true" />
                        </display:table>

RatingAdjustmentHistoryTableDecorator - 用于装饰器

将displaytag.jar文件粘贴到您所在的位置*YourApplicationName*/Webcontent/WEB-INF/lib/ displaytag-1.2.jar`

display tag Overview

display:column用于显示您的列 property用于java文件中定义的bean名称 title用于显示表格的标题 sortable用于对单个列进行排序 name用于使用表单名称获取列表 uid是唯一标识符,用于将表存储为对象 keepStatus用于维护表的状态,直到会话到期

如果您仍然面临这个问题,请告诉我。感谢。