struts
2012-05-24 75 views 1 likes 
1

我試圖做到這一點,但它不起作用。Struts如何插入bean:在bean中寫入:消息參數

<logic:present name="MEMBER" > 
<bean:message key="member.registerConfirmation" arg0='<bean:write name="MEMBRE_REGISTER" property="firstname"/>' arg1='<bean:write name="MEMBRE_REGISTER" property="lastname"/>'/> 
</logic:present> 

和豆製品:含有消息:

member.registerConfirmation = Congratulations {0} {1}, you are in ! 

回答

4

嘗試EL豆:消息

這樣的事情。

<bean:message key="member.registerConfirmation" arg0='${MEMBRE_REGISTER.firstname}' arg1='${MEMBRE_REGISTER.lastname}'/> 
+0

它的工作100%!非常感謝:) – ilias

+0

一個注意:參數非轉換,使他們容易受到XSS攻擊。你可以這樣做:''然後執行'arg0 ='$ {firstNameEscaped}''etc 。 –

相關問題