Extensions to Spring’s FreeMarker macro’s (spring.ftl)

Spring’s FreeMarker macro’s are pretty useful, but there are a couple of things I need from the showErrors macro that simply aren’t there:

  1. Show errors without a HTML tag around them – if you don’t specify a classOrStyle, the showErrors macro will wrap your error message in a <b> tag. If you do, it’ll wrap it in a <span> (understandably)
  2. Pick the tag that surrounds each message – As explained in the first point, you can see we only get the choice of <b> or <span>. What if I wanted to use an <li>? …use the separator? – no good, because unless I write an <#if> statement to check the number of error messages before I call showErrors I’ll end up with redundant <ul>/<ol> and <li>’s in my markup if there aren’t any errors:
    e.g. <ul><li><@spring.showErrors “</li><li>”/></li></ul>
    Which leads me nicely onto the next point:
  3. Show errors in an ordered/unordered list, automatically detecting zero messages and not outputting markup if this is the case
  4. Show errors for multiple bind paths – Spring’s showErrors only shows errors for the currently bound field. However I’ve found that I’ve needed to show errors for 2 or more fields together. This is particularly true of a DOB field where the day/month and year are separate <select>’s
  5. Finally, show errors for multiple bind paths, in an unordered/ordered list

You can download my Spring extensions here: springx.ftl. Inevitably I’ll find more bits and pieces to add and will update them accordingly.

13,370 thoughts on “Extensions to Spring’s FreeMarker macro’s (spring.ftl)

  1. У Куми https://u-kumy.com жіночий сайт з порадами на всі випадки життя. Мода, краса, діти, стосунки, сонник та смачні рецепти.

  2. Dekorasyona yeni bir gozle bakmaya ne dersiniz? Hem estetik hem de islevsellik on planda!

    Особенно понравился раздел про Lezzet Duraklar?: Turk Mutfag?n?n En Ozgun Tat ve Tarifleri.

    Смотрите сами:

    https://sofrasihri.com

    Gelecek yaz?lar?m?zda bulusmak uzere, dekorasyona dair en iyi fikirlerle burada olacag?z.

  3. גלינה התנשמה בהנאה עטפה אותו בכף ידה העובדת והמחוספסת ומיד ללא התייחסות נוספת לקחה אותו לפה. מעצמי והגעתי לעומקו. היא צרחה גירדה לי את הגב רגליה אוחזות בי. המתח הגיע לשיא. הרגשתי את כל מה https://sexmaster.co.il/

  4. Компания Таврнеруд https://tareksa.ru производство и продажа нерудных материалов сервис логистических услуг а также проектирование в области технологии обогащения нерудных материалов проведение лабораторных испытаний нерудных материалов.

  5. Do you love puzzles? This puzzle game game features challenging levels well-thought-out mechanics and relaxing gameplay. Solve riddles unlock new levels and test your problem-solving skills anytime anywhere.

  6. I know this site provides quality dependent articles and additional data, is there
    any other site which presents these data in quality?

  7. Нужен сайт? разработка на битрикс москва включает проектирование удобный интерфейс быструю загрузку интеграцию с 1С и CRM. Подбираем решения под задачи бизнеса и обеспечиваем техническое сопровождение.

  8. Could everybody percentage experiences about searching a balance among unfastened play and established activities at homestead after attending preschool ? I’d love details ! ### anyKeyWord### infant child care

  9. Нужен сервер? https://karafelov.ru/ лучшие по мощности и стабильности. Подходят для AI-моделей рендеринга CFD-симуляций и аналитики. Гибкая конфигурация надежное охлаждение и поддержка нескольких видеокарт.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>