我試圖Freemarker的HashLiteral傳遞給我的自定義方法如下:Freemarker的方法不能接受對象作爲參數
<a href="${href("Item", {"item": item})}">...</a>
,其中不包括引號項目在ModelAndView中給出的對象。該{"item": item}
正確地轉化爲freemarker.core.HashLiteral$SequenceHash
,但我不能在我的方法恢復它我得到例外以下:
Expecting a string, date or number here,
Expression {"item": item} is instead a freemarker.core.HashLiteral$SequenceHash
出現這種情況,即使href
方法有空體:
感謝
「href」方法的定義是怎樣的? – ddekany 2012-02-28 15:32:18
我已將href方法添加到問題中。 – 2012-02-29 06:10:04