http://struts.apache.org/2.x/docs/freemarker.html
Towards the bottom. --- Scott Kingdon <[EMAIL PROTECTED]> wrote: > If that works that would be great. I tried it, but > maybe I am doing > something wrong. > > In the JSP world, in order to use an el function you > need to declair > it at the top of the page like this: > > <%@ taglib prefix="uni" uri="UniFunctions" %> > > When I put this at the top of a Freemarker page, it > just gets printed > out to the page as text. So that does not work. > > I tried declaring it in the JSP page before the > freemarker template is > called. Then I called the el function like this in > my template.ftl: > > ${uni:phone(session.USER.customer.phone)} > > This spews out a nasty error. Freemarker complains > that it does not > know what to do with uni:phone. > > =========================================================== > > On Nov 9, 2007 4:08 PM, Dave Newton > <[EMAIL PROTECTED]> wrote: > > Since you can use any S2 tag inside a FreeMarker > > template I guess I had assumed you could use the > same > > syntax to call static methods you can from JSP, > does > > that not work? > > > > (AFAIK you can also expose the JSTL library to a > > FreeMarker page but I'm not sure how the two ELs > would > > play together; w/ OGNL you can use the %{...} EL > > escape.) > > > > d. > > > > > > --- Scott Kingdon <[EMAIL PROTECTED]> wrote: > > > > > I am very used to using JSP taglibs and el > functions > > > for formatting > > > text. In my current application I am using > Struts2 > > > with Freemarker as > > > the templating engine. I need to format a phone > > > number that is pulled > > > from the database as 8888888888 to be > (888)888-8888. > > > Using el > > > functions you can just call a static method from > > > some class. This > > > would be nice since I already have that static > > > method and it is used > > > elsewhere in the app. > > > > > > I would use JSP for this, but our template is > > > already built in > > > Freemarker. There are also come JSP pages that > use > > > this phone > > > formatter as well. Actually I have already > created > > > the el function tag > > > and have been using it all over in the app. > > > > > > I have tried several things including trying to > use > > > el functions in > > > freemarker or even including JSP pages from > > > freemarker. > > > > > > Any ideas how this is done in the > Struts2/Freemarker > > > world? I am open > > > to any idea. > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]