On Wednesday, June 25, 2003, at 09:52 AM, David Graham wrote:
The generalized tag would be:
<custom:label key="some.label.key" property="fieldName"/>

I don't see that as being much harder to use than the custom version.

But I hate duplication! :) In my case it would look like this:


<custom:label key="FormName.fieldName" property="fieldName"/>

There is no point in me duplicating the field name. In fact, perhaps the default behavior could simply be this:

<custom:label property="fieldName"/>

Where the form name is obtained from the parent <html:form> tag, and the key name defaults to FormName.fieldName. Is that an unreasonable default behavior? I shy away from making "conventions" be built-in, but duplication also sucks. Thoughts?

These 2 features are rather specific to your needs. Customizing a Struts
label tag to add them seems appropriate.

Let's make sure the tag we create is subclassable nicely then :)


Struts can't build in all of the features specific to your app (like the
database functionality). I think an appropriate goal is to create a label
tag that most people can use easily and can be subclassed to add custom
features.

Actually the database functionality is not at all part of the tag itself. Its just using the Struts resource mechanism, which (irrelevant to the tag code) is a custom MessageResources implementation.


Erik


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



Reply via email to