This isn't really Struts specific, but I'm trying to wrap some of the Struts HTML tags with tag files (in order to compose them into more complex 'controls') and I'm running into a slight problem... Some attributes are mutually exclusive (e.g. 'alt' vs. 'altKey'). I can't see a way to pass attributes through from the tag file to the Struts tag that works with this constraint. For example, if I write a tag file like this:

<[EMAIL PROTECTED] name="property" required="true" rtexprvalue="true"%>
<[EMAIL PROTECTED] name="alt" required="false" rtexprvalue="true"%>
<[EMAIL PROTECTED] name="altKey" required="false" rtexprvalue="true"%>
...
<html:text property="${property}" alt="${alt} altKey="${altKey}" .../>

then, regardless of whether I set alt and/or altKey in the call to the tag file, the html:text tag complains that I can't specify both attributes. I've tried passing in the values using "${empty alt ? null : alt}" but get the same result.

Does anyone know a way to work around this (i.e. a 'correct' way to pass-through attributes from tag files to custom tags)?

Failing that, how big a deal would it be to change the Struts tags to treat the empty string equivalently to 'null' when performing these checks? [I'll happy put together a patch to do that]

L.


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

Reply via email to