它是提供显示“本地化”支持的:
<bean:write>
In the Struts 1.1 release, <bean:write> gained the format property. This provides a
way to apply a standard formatting template against the value being written:
<bean:write name="inputForm" property="amount" format="$#.##"/>
A formatKey property is provided that reads the template from the resource bundle:
<bean:write name="inputForm" property="amount" formatKey="pattern.currency"/>
A locale property is also provided if another Locale object is to be used instead of
the framework’s default. The locale property indicates the name of a sessionscope
attribute:
<bean:write name="inputForm" property="amount" formatKey="pattern.currency"
locale="myLocale"/>
STRUTS TIP Don’t use custom tags to format data. Instead, localize data inside an ActionForm
or (even better) on the business tier. You can easily pass the
Struts Locale object to the ActionForm (or your business bean) and apply
the localization in the getter. To store the user’s Locale object in your ActionForm,
add a locale property and put this code in the reset method:
HttpSession session = request.getSession();
if (session!=null) {
setLocale((Locale)
session.getAttribute(Action.LOCALE_KEY));
}
else {
setLocale(Locale.getDefault());
}我觉得你不必这么做。actionform里的属性可以完全用string,不必使用 int型或其它