【问题标题】:web.xml configuration Display tagweb.xml 配置显示标签
【发布时间】:2013-03-04 12:28:23
【问题描述】:

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

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

【问题讨论】:

  • @parmer,我为你发布了答案..你仍然面临这个问题..
  • 如果以下任何答案对您有用。点击接受答案(右符号)。谢谢
  • 能否请您粘贴您的代码,这可能有助于我识别问题..谢谢
  • cant .. m new... 添加粘贴代码的一些限制

标签: java jsp jsp-tags displaytag


【解决方案1】:

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

显示标签用于在您的网格数据中进行分页排序

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

并在您的jsp页面中编写标签库,例如:

   <%@ 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/

【讨论】:

  • 可以在我的 servlet 中通过 ny prb 获得吗?
【解决方案2】:

示例 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用于维护表的状态直到会话过期

如果您仍然遇到问题,请告诉我。谢谢。

【讨论】:

  • 实际上我已经在我的 servlet 中使用了 bean列表中的 dat bean 对象.. 我是在这里使用 dta 列表
  • 等一下,我会检查并告诉你
  • 你关闭了显示标签吗
  • 是的,我关闭了显示标签
猜你喜欢
  • 1970-01-01
  • 2014-12-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-07
  • 2012-02-18
  • 1970-01-01
  • 2018-09-16
相关资源
最近更新 更多