wrynn
asked on
jsp tag file question
im creating a single tag file (not a tag library)
if i define an attribute in my tag file as required=true, what happens if someone uses my tag and completely leaves out that attribute?
also how can i make it so that if one attribute is specified as "false" when someone uses my tag it then requires another attribute to be defined but if its true then the attribute is not required.
if i define an attribute in my tag file as required=true, what happens if someone uses my tag and completely leaves out that attribute?
also how can i make it so that if one attribute is specified as "false" when someone uses my tag it then requires another attribute to be defined but if its true then the attribute is not required.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the very nice idea rrz and thanks for the info fargo!!!
ASKER
oops i was gona try to split the points but i messed up sorry fargo
No problem. The explanation from rrz is better.
required=true means the attribute must be defined (you can not leave it out)
For dependent attribute or attribute validation, you may use TEI tag extending the TagExtraInfo class. Have a look at the following link for "Attribute Validation"
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags5.html