1

カンマ区切りでフォーマットする必要がある 20 桁を超える数字があります。http セッションから値を読み取る必要があります。私はこの種類を使用しました:

<s:property value="%{getText('{0,number,#,###.00}',{<%=hsession.getAttribute("calculated_forfeit") %>})}" /> 

しかし、それは機能せず、エラーは次のとおりです。等号が必要です!!!!!!!!! getText 形式は変数に対して機能しますが、http セッションからの値についてはわかりません。技術はstruts2です。

助けてください

4

1 に答える 1

3

You have to put simple quotes in the scriptlet:

 <s:property value="%{getText('{0,number,#,###.00}',{<%=hsession.getAttribute('calculated_forfeit') %>})}" /> 

Anyway, struts2 provides a simple way to access to session attributes with #session variable.

<s:property value="%{getText('{0,number,#,###.00}',{#session.calculated_forfeit})}" /> 
于 2012-08-08T07:08:34.923 に答える