2014-05-02 16 views
0

平鋪定義我有什麼是:設置和獲取價值的支柱瓷磚

<definition name="test" path="/t/x/test.jsp" controllerUrl="/x/t/sController.do"> 
</definition> 

這是我如何使用它在我的jsp頁面:

<tr>   
    <td > 
     <tiles:insert definition="/test" flush="true" > 
      <tiles:put value="Antony" name="tileTitle" /> 
     </tiles:insert>  
    </td>  
</tr> 

,這是我的打印方式:

<% 
    ComponentContext context = ComponentContext.getContext(request); 
       if (context != null) 
       { 
        String tileTitle = (String)context.getAttribute("tileTitle"); 

        if (tileTitle != null) 
        { 

    %> 

    <tr> 
     <td><jsp:include page="/common/tab.jsp" > 
      <jsp:param name="TAB" value=" Week '<%= tileTitle%>>' "/> 
     </jsp:include> 

     </td> 
    </tr> 

    <% 
    } 
    %> 

當我敲響的應用程序,我得到下面的異常Expecting "jsp:param" standard action with "name" and "value" attributes

那麼我如何設置他的價值並將其傳遞給瓷磚?

感謝

回答

0

瓦「test.jsp的」在裏面你可以使用

其中名稱是您指定什麼在呼喚的.jsp和 id是一個你可以在你的瓷磚用。

它可以在JSP標籤通過聲明

<html:hidden property="tileTitle" value="<%= title.toString()%>"/>

用作 <%=tileTitle.toString()%>

或支柱標籤