Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Remember that all tag attributes must first be set as Strings - they are then later evaluated (using OGNL) to a different type, such as List, int, or boolean. This generally works just fine, but it can be limiting when using FreeMarker which provides more advanced ways to apply attributes. Suppose the following example:

...

What will happen here is that each attribute will be evaluated to a String as best it can. This may involve calling the toString method on the internal FreeMarker objects. In this case, all objects will end up being exactly what you would expect. Then, when the tag runs, the list attribute will be converted from a String to a List using OGNL's advanced collection support.

...