Re: Formatting strings in Struts2/Freemarker

2007-11-12 Thread Scott Kingdon
This worked! Thank you, Wes!! @s.property value=@[EMAIL PROTECTED]('${Session.USER.customer.phone}')/ On Nov 9, 2007 9:29 PM, Wes Wannemacher [EMAIL PROTECTED] wrote: Have you tried to use a struts2 tag with OGNL? If I am understanding

Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
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 88 to be (888)888-. Using el functions you can just call

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
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

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
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

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
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

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
Thank you for that. That was a huge step in the right direction. However, that does not work. freemarker.core.InvalidReferenceException: on line 4, column 146 in template/xhtml/components/loginlink.ftl unitag.phone not found. I found a snipped over on Freemarker's forum that says Freemarker

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
--- Scott Kingdon [EMAIL PROTECTED] wrote: Thank you for that. That was a huge step in the right direction. However, that does not work. *lol* Huge step off a short pier--I'm good at those. Hmm, yeah, I didn't know about the lack of JSP tag file support, but that's a good one to keep a handle

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Wes Wannemacher
Have you tried to use a struts2 tag with OGNL? If I am understanding correctly, you could use - @s.property value=@[EMAIL PROTECTED]('OGNL.pathTo.variable') Of course, I don't know freemarker, and this is assuming you can reach the variable from OGNL. -W On 11/9/07, Scott Kingdon [EMAIL