On Tuesday, July 12, 2011, <struts....@spamgourmet.com> wrote: > Which of these is more correct when using Struts2 freemarker tag dynamic > attributes for @s.url: > > <@s.url action="viewitem" itemid="${item.itemid?c}" /> > or > <@s.url action="viewitem" itemid=item.itemid /> > > I've been favoring the second example, since it doesn't require me to > remember to do "?c" for my integer arguments, and appears to properly exclude > parameters that have null values from the resulting URL.
I wouldn't have guessed it'd render the value, actually. I guess the tag itself is doing the eval, and not FreeMarker, in the second case, maybe? > This is common enough that I believe the "Attribute Types" section of the > freemarker tags document should include an example for an integer. [...] Or > maybe it's "obvious." I don't know if it "obvious" or not, but it is a well-known FreeMarker function and is documented pretty well. Like you said, it's common enough, and the FreeMarker docs reflect this. No reason /not/ to have an example, though. Dave --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org