1

Attributes in Custom JSP tag can be set as required by using the following snippet:

<attribute>
    <name>imageId</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
</attribute>

Is there any way to specify one of two attributes as required?

1 Answers1

0

Either you can make an attribute optional or mandatory.There is not a way to put a condition which can check if one of them is there.

From Documentation

<required>true | false</required>

  (Optional) Defines whether this attribute has optional use in the JSP page.

  If not defined here, the default is false — that is, the attribute is optional by
  default.

  If true is specified, and the attribute is not used in a JSP page, a
  translation-time error occurs.

See Also

Community
  • 1
  • 1
RockAndRoll
  • 2,247
  • 2
  • 16
  • 35