freemarker

How to check prameter in freemarker

Hi Can anyone help me, I am calling a ftl page on a link, i need to check whether the link have parameter or not. How will I check whether the link have any parameter or not. ...

Freemarker escaping freemarker

I'm using freemarker to generate a freemarker template. But I need some way to escape freemarker tags. How would I escape a <#list> tag or a ${expression} ? ...

FreeMarker Editor in eclipse 3.5 giving Illegal Argument Exception

I am trying to use the freemarker editor in eclipse 3.5 Galileo and found the exception : java.lang.IllegalArgumentException: Argument not valid at org.eclipse.swt.SWT.error(SWT.java:3865) at org.eclipse.swt.SWT.error(SWT.java:3799) at org.eclipse.swt.SWT.error(SWT.java:3770) at org.eclipse.swt.custom.StyledText.setStyle...

How do you escape regex strings in Freemarker

I am using the matches string builtin and need to run a regex pattern (Views:).*?(span>)(.*?)(<\/div) However, Freemarker freaks out because of the ">" character which is a special character in Freemarker. Any ideas how to get round this? ...

Indirect reference in Freemarker

Using freemarker, is there any way to reference a value indirectly along the lines of... <#assign apple=fruit> <#assign item=apple> ${${item}} to produce the output 'fruit' without prior knowledge of what value item might contain? ...

Setting the content-type of a response in Struts2

So, I'm using freemarker templates with Struts2 to formulate my responses. However, since I'm trying to use taconite as well, I need the response to be sent with the content type of "text/xml". I can't seem to find a way to use freemarker directives to set the content type, and I am not well versed enough in struts to know if there is ...

Is there a way to just copy resources when using a Maven archetype (no Velocity)?

We are using a Maven archetype to create an initial setup for projects using our framework, which relies heavily on Freemarker. As a consequence we need to copy a few Freemarker templates when the archetype is used to generate a new project. The problem we ran into is that Maven seems to run Velocity on all of the files listed as resour...

Spring Security Custom freemarker form

Hi experts! I'm currently working on a project were we use freemarker as a template language. Instead of using the defualt login form I have created a custom controller and a custom freemarker view which goes along with that controller Code: @Controller public class LoginController { private static finaal String LOGIN = "components/se...

FreeMarker, WebWork Problem

I have a web application written using freemarker, webwork and java. Now when user clicks on "getReport", java code returns the string variable (named "otchet") which contains the whole report in plain text and the following page is displayed: simple.ftl: <#if (otchet?exists)> ${otchet} <#else> <@ww.text name="report.none"/...

Freemarker template not found

Hi, I'm currently trying to get Freemarker to work with my application using Spring. No matter what I try I keep getting template not found. I am not sure if I have the configuration set up properly, but it never finds my template. Here is my spring bean config: <bean id="freemarkerConfig" class="org.springframework.web.servlet.vie...

Nullable date in Freemarker

This is a piece of my freemarker template: ${order.needByDate?if_exists?date} I want it to work as following: if needByDate is null, then write nothing if it is not null, then write the date part The above works only in second scenario. What is the correct way to achieve this? ...

How can I introspect a freemarker template to find out what variables it uses?

I'm not at all sure that this is even a solvable problem, but supposing that I have a freemarker template, I'd like to be able to ask the template what variables it uses. For my purposes, we can assume that the freemarker template is very simple - just "root level" entries (the model for such a template could be a simple Map). In other...

How can I get block comment hotkey functionality when editing *.ftl files in Eclipse?

Trying to edit Freemarker Templates in Eclipse, and going nuts because I have some inline Javascript that I'm creating on the fly, and can't easily comment / uncomment multiple lines at a time. I've tried the following: expanding the scope of the "toggle comment" behavior (to things like "Editing Text", or "In Windows") - has no effec...

one template to several output files with fmpp

I want to set up an maven plugin that will take a few freemarker templates, and expand each one several times, each time with a different set of input values. Is there any better way to do this with fmpp that brute force processing them over and over? ...

can freemarker be used to output custom collections?

Can freemarker be used to loop through collections and output the properties of each item in the collection? This collections properties will be dynamic i.e. can't be hard coded, will be generated from the database. what I am looking for: be able to point to different databases, and loop through each table and output the tables column...

Can a freemarker viewpage be 'user' editable and secured?

If I let anyone modify a freemarker viewpage, can I somehow make it hack free? I know I read somewhere that I can make disable scriplets, but that was for .jsp pages so not sure if it will work with freemarker. I basically want a way where I can set the attributes that will be available on the page, and let web designers go into the pa...

How to display the current date & time in the Freemarker template section of smooks?

Hi , I am able to display the contents of my incoming XML file using smooks in the freemarker template, but I want to add Current Date & time of my local system to identify the execution of my program. <ftl:freemarker applyOnElement="CreditCard"> <ftl:template><!-- <BalanceInquiryRequest> <TransactionId>${BalanceI...

email integration along with struts

Is there anything similar to freemarker that can be used along with struts. ...

spring freemarker

Hi I am new to freemarker.I have a spring application.In that I am planning to use freemarker.Templates will be stored in database.Based on the login I retrieve template from database.Can any one tell me how to configure the freemarker in spring and get the html tags as a string after constructing the template.I did googling.But I could...

Request parameters in Freemarker on Spring 2.5

Hi! I am trying to get request parameters on freemarker page. But I can't figure out how to setup implicit variables like RequestParameters or so. Here is a thread http://forum.springsource.org/showthread.php?t=32846 but I don't where he setup that RequestParameters object. The only thing I found in docs (more in source code), that ...