|
For Struts platform, formatting involves the inputText and
outputText elements.
The specification of format is based on Java formatting that
is based on these classes.
java.text.SimpleDateFormat
java.text.NumberFormat
java.text.DecimalFormat
outputText
The implementation for output text would used the bean:write
tag; which has the format attribute, which could include the specified format
string as shown below.
<bean:write name="dueDate" format="MM/dd/yyyyy"/>
It could also be externalized into a key.
<bean:write name="dueDate" formatKey="fmt.date.short"/>
inputText
Struts does not provide direct support for formatting input
texts, either on first display on the page, or during or after editing the
text.
There are however some common patterns that would provide
the formatting as logic within the form bean; these also could accommodate
internationalization. For on screen formatting, client scripting would need to
be employed.
|