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.

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

  1. 1. ดูสิ ผมเพิ่งถอนเงิน 4,200 บาทออกไปเมื่อวานนี้ ใช้เวลาแค่ 8 นาทีเอง จริงๆ แล้วเร็วดีนะ แต่ตอนฝากเงินครั้งแรกนี่งงอยู่เหมือนกัน ว่าเงินจะเข้าระบบตอนไหน ใครเคยเจอแบบนี้บ้าง?

    2 โปรโมชั่นเว็บพนันไม่ผ่านเอเย่นต์

  2. Черкассы новости https://u-misti.cherkasy.ua на городском портале у мисти. Последние события, обзоры, транспорт, много полезного и интересного

  3. 1. ตอนแรกไม่แน่ใจเหมือนกันว่า brazil999 จะโอเคไหม แต่ลองถอนเงิน 3000 บาท ได้ภายใน 2 ชั่วโมงจริงๆ ดีจริง เล่นบนมือถือไม่กระตุกเลย แนะนำให้ลองดูนะครับ ใครเคยถอนเงินเยอะๆ บ้าง?

    2 https://telegra.ph/%E0%B8%A5%E0%B8%A1%E0%B8%A3%E0%B8%AB%E0%B8%AA%E0%B8%9C%E0%B8%B2%E0%B8%99%E0%B8%84%E0%B8%B2%E0%B8%AA%E0%B9%82%E0%B8%99%E0%B8%97%E0%B8%B3%E0%B8%A2%E0%B8%87%E0%B9%84%E0%B8%87-%E0%B8%84%E0%B8%A1%E0%B8%AD%E0%B8%89%E0%B8%9A%E0%B8%9A%E0%B8%84%E0%B8%99%E0%B9%80%E0%B8%A5%E0%B8%99-Instant-Access-Games-12-23