Hi,
I was trying to use the value of a Java-class' static final field as part of
an EL-based value, but it didn't work. Is this a wierd thing to want (I was
trying to standardize a certain fmt:formatNumber pattern for multiple uses)?
Is it supported and I just have the syntax wrong? (I traced part of the
code into JSTLVariableResolver.resolveVariable() which appears not to handle
this case.) It works fine if I hard code the format, or if I reference the
static field using the RT version of the tag. Here is some sample code:
//JSP_CURRENCY_FORMAT_STRING is defined in the Constants interface as:
public static final String JSP_CURRENCY_FORMAT_STRING =
"#,##0.00;(#,##0.00)";
//these three work as expected (though of course #3 doesn't do any
formatting):
1) hard-coded = <fmt:formatNumber value="12015.3"
pattern="#,##0.00;(#,##0.00)"/><br>
2) constants,rt = <fmt-rt:formatNumber value="12015.3"
pattern="<%=Constants.JSP_CURRENCY_FORMAT_STRING%>"/><br>
3) empty = <fmt:formatNumber value="12015.3"/><br>
//this one doesn't work. the ouput is like #3 above (no formatting)
4) constants = <fmt:formatNumber value="12015.3"
pattern="${com.rescapayments.system.Constants.JSP_CURRENCY_FORMAT_STRING}"/>
<br>
Any thoughts?
thanks,
Solomon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]