我've created a custom JSP tag that is supposed to accept a list of products to render, but I'我無法弄清楚如何將列表傳遞給標簽 . 產品列表作為頁面范圍的bean存在 . Web應用程序使用Struts taglib在Struts 1.2.x中編寫 .
這是我的代碼的簡化版本:
renderProducts.tag
ProductDetail.jsp
但是,當我查看頁面時,我得到一個例外:
無法將字符串“$”轉換為類“[Lcom.foo.ProductIf;”屬性“products”:Property Editor未向PropertyEditorManager注冊
所以似乎 ${} 語法不是我需要做的,因為無論如何它被解釋為文字字符串 . 我也試過傳遞沒有 ${} 的bean的名稱,結果相同 . 什么是正確的語法?
(注意:請原諒我,如果這個問題 Build 在糟糕假設的基礎之上,但我是Java EE開發的新手,而且還有相當多的笨拙的蠢貨 . )