Extending Spring form tags

Extending form tags

Building conditional tags

Override writeTagContent inside your tag class and return whether to evaluate the body. That is how you implement conditional logic.

Outputting raw text without TagWriter

Not recommended, but if you must render raw text, skip TagWriter. Spring tags inherit PageContext, so you can write directly via JspWriter:

this.pageContext.getOut().print("text")

Other tips