0
我正在嘗試使用Struts2屬性標記來顯示bean的值。我的代碼在jsp頁面如下:Struts2 propertytag
<table>
<thead>
<tr>
<s:bean name="com.section.entity.SectionOrder" var="sectionOrder" />
<th colspan="4" class="head">
<s:property value="#sectionOrder.name" /></th>
</tr>
</thead>
但是沒有輸出。希望有人能提供建議。謝謝。
您已創建對象的實例,但其屬性未設置。爲什麼要打印任何東西? – 2014-10-28 09:08:20
嗨Aleksandr,在這個jsp頁面被觸發之前,調用一個DAO類,它是dB操作,並設置SectionOrder對象中的值。我沒有提前發佈該代碼,這裏是 public String getName(){ return name; } public void setName(String name){ this.name = name; } – Sor 2014-10-28 09:20:19
當我在這裏添加評論時,我無法獲得格式化權限...對於給您造成的不便,我深表歉意...... :( – Sor 2014-10-28 09:24:35