Link to home
Start Free TrialLog in
Avatar of wrynn
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.
Avatar of fargo
fargo

--> 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?
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
ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wrynn

ASKER

thanks for the very nice idea rrz and thanks for the info fargo!!!
Avatar of wrynn

ASKER

oops i was gona try to split the points but i messed up sorry fargo
No problem. The explanation from rrz is better.