• Post Reply Bookmark Topic Watch Topic
  • New Topic

tag file parameters  RSS feed

 
Jim Largent
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a tagfile and I want to have an either/or required parameter. In other words, you must specific 1 of 2 parameters. Any suggestions on how best to approach this? Right now I've just made them all optional and rely on myself to know that I need to specify one or the other.
Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tag files are great and I use them a lot, but they don't give you a lot of computational capabilities. If possible, I'd rejigger things such that there is one required parameter.

If that's not possible you could consider one of:
  • Make them both required, but allow one to be empty. [Yuck]
  • Leave them optional, and provide a reasonable default for when neither is specified.
  • Use a helper bean within the tag to do some validation (what I fancifully call a "Valet").
  • Revert to using a SimpleTag implementation instead of a tag file.

  •  
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!