struts2 OGNL + displaytag 問題

來源:互聯網
上載者:User

還是那句話, 這兩天在倒騰struts2, 而且用上了displaytag.

如果光是使用displaytag, 問題不大.

但是, 有這樣一個問題. 一個List, model有個屬性指向了一個Dictionary的id.

 

1. Dictionary是在application中儲存著.

2. Display要顯示的List中, 每個Item有一個屬性是指向了Dictionary的bean的id.

 

問題來了,

我在Displaytag中, 用jstl和struts的tag輸出都沒有問題, 但是Displaytag中直接用struts2 tag就有問題了.

比如 (假設item中有一個欄位名字為type):

1) 你在Dispalytag中指定了uid="item"

2) 在<display:column/>中, 直接用c tag or s tag輸出, 都沒有問題. <s:property value="#attr.item.type"/> or <c:out value="${item.type}"/>.

3) 但是, 如果合起來就有問題了. 如果在<display:column/>中, 使用struts2 tag, 比如<s:property value="#application.globalTypes[#attr.item.type]"/>, 這就有問題了.

 

不知道是不是struts2 tag的問題, 沒法在tag中使用兩次#.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.