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.

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

  1. First thing’s first: lighting makes or breaks your listing photos. I can’t count how many overpriced homes I’ve scrolled past that look dark and dreary simply because the seller or agent ignored natural light or decent bulbs social media property ads

  2. Every driver should know their rights and have access to experienced legal counsel like those at leading firms specializing in accidents across GA—don’t go it alone without asking for help from experts like them today!! # # anyKeyord ## commercial truck accident lawyer

  3. Man kann in lizenziertenOnline Casinos mit PayPal zahlen, Kryptowährungen wie Bitcoin oder Litecoin sind
    jedoch ausgeschlossen. Dort sind Online Casinos mit Echtgeld
    aufgeführt, die sich an die strengen Regularien halten. Seitdem wächst die Liste der offiziell
    lizenzierten Anbieter stetig. Juli 2022 nahm die
    Gemeinsame Glücksspielbehörde der Länder (GGL) ihre ersten Aufgaben auf.
    Juli 2021 trat der Glücksspielstaatsvertrag in Kraft, um
    mehr Sicherheit zu schaffen und den Glücksspielmarkt zu vereinheitlichen. Viele
    Echtgeld-Casinos sind mit der GGL-Lizenz ausgestattet.
    Wie wir die Echtgeld Casinos bewertet haben, stellen wir in unserem
    Testbericht vor. Somit sehen wir die Echtgeld
    Casinos mit EU-Lizenz als keine Alternative an. Gerade zum Thema Online Casinos
    mit Echtgeld kommen besonders viele Fragen rein, was ja auch verständlich ist.
    Doch die Anbieter in unserem Online Casino Echtgeld Test sind alle für
    mobile Geräte gerüstet. Diese haben wir in unserem Test der Online Casinos mit Echtgeld Spielen auch angewendet.
    Häufig geschieht das mit neuen Spielanbietern oder innovativen Bonusangeboten.

    References:
    https://online-spielhallen.de/bwin-deutschland-casino-bonus-spiele-login/

  4. Finding an Optometrists who speaks your language(s) can be such a relief when discussing sensitive topics related directly towards our eyesight & wellbeing ! ## anykeyword ## eye exam

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>