DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17391>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17391

HTML text tag needs to format its content like Bean write





------- Additional Comments From [EMAIL PROTECTED]  2003-02-25 22:43 -------
This sounds useful on the face of it, but in practise I believe it is 
untenable. This is due to the round-trip nature of the <html:text> tag and its 
interaction with the form bean. In addition, such an attribute results in both 
the Action (or possibly ActionForm) and the JSP page having to have (the same) 
knowledge of the text formatting.

Suppose that your form bean property has the value "300" (as a String). When 
the page is displayed, the value in the text box might now be shown as "$300". 
If the user now submits the form - without changes - the form bean now has the 
value "$300". Notice that the property value changed *without the user making 
any change to the value*. The code that put "300" in the property now has to 
deal with "$300" coming back, and has to "know" the specific format that the 
JSP page used, in order to be able to untangle the text and retrieve the "real" 
value.

In addition, as James points out, going back to the JSP page without modifying 
the property value will cause the formatting to fail. This is not related to 
whether the property is a string or an integer. Trying to format "$300" as a 
currency value will fail even if there is an implicit string-to-number 
conversion in the format code, because "$300" is not a valid number. Even if 
the formatting simply prepended a '$', now you'd end up displaying "$$300".

This just isn't workable. If the property value needs formatting, then the 
formatting and the parsing of that format need to both happen either in the 
ActionForm or in the Action itself.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to