2016-11-21 80 views
0

我在使用DisplayTag構建表格。我需要在許多頁面中的表之間共享一列,所以我試圖插入<display:column><display:table>使用<tiles:insertAttribute>DisplayTag和Tiles

<display:table ....>  
     <tiles:insertAttribute name="attivoTh"/>  
    </display:table> 

<definition name="attivoTh" template="/WEB-INF/template/default/th/attivoTh.jsp" /> 

這是錯誤我得到:

nov 21, 2016 2:08:08 PM org.apache.catalina.core.StandardWrapperValve invoke 
SEVERE: Servlet.service() for servlet [ds] in context with path [/Jeans2016] threw 
exception [Request processing failed; nested exception 
is org.apache.tiles.impl.CannotRenderException: ServletException including 
path '/WEB-INF/template/default/template1.jsp'.] with root cause 
Exception: [.ColumnTag] Tag "column" should ne nested in "table" 

有誰理解爲什麼?

回答

0

您的顯示錶使用集合。 在該集合中,您放置了對象。 如果許多不同的表使用相同的值/對象,則在集合服務器端提供該對象。 (你可以使用一個包裝)

爲對象的Foo在當時只提供了

<display:table ....>  
     <display:column property="foo.value" .../>  
</display:table> 

或者,這使該對象中所有小服務程序,顯示這些表格可以從基本的servlet進行擴展/值並添加具有該數據的列:

<display:table ....>  
     <display:column ...>  
     ${foo.value} 
     </display:column>  
</display:table>