Forums Register Login

tag file parameters

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.

  • It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 995 times.
    Similar Threads
    how to prevent sql injection
    getting servlet parameters in one file to reuse it
    Context Parameters - Thread safe?
    how to submit form parameters using window.open
    Posting request to other domain using jsp
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 29, 2024 02:12:59.