Questions tagged [freemarker]

Apache FreeMarker™ is a template engine: a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data.

freemarker
Filter by
Sorted by
Tagged with
1 vote
1 answer
5k views

Bean Bind to form using Freemarker

I try to bind a bean to a form snippet from the form: [#ftl/] [#import "spring.ftl" as spring /] [#import "panda.ftl" as panda /] [#import "discoveryProject.ftl" as discoveryProject/] [#macro ...
Muhammad Bekette's user avatar
3 votes
2 answers
1k views

Struts 2 Template not found

I created a new theme template for Struts 2. So I placed following code into my struts.xml: <constant name="struts.ui.theme" value="mynew" /> Where is this template ...
Erkan's user avatar
  • 153
2 votes
2 answers
776 views

unwanted values returning in Freemarker iterating maps

When iterating map <#list map?keys as key> ${key} </#list> will return clone,1,getKey,5,etc Anyone have solution instead of removing unwanted value one by one ?
Janith's user avatar
  • 365
1 vote
2 answers
2k views

How to Pass Workflow Propert in Control-Parm to FTL File in Alfresco?

So for my project, we have some javascript code running as a rule within the Alfresco repository. So whenever a new document comes into a certain space, a new folder is dynamically created and that ...
This 0ne Pr0grammer's user avatar
0 votes
1 answer
1k views

Freemarker website throws error with IE10 [closed]

When I open this website on IE10 desktop, it shows the Freemarker error stack. Error: on line 18, column 32 in WEB-INF/ftl/common/requestVariables.ftl Expecting a number here, found: . The ...
Annie's user avatar
  • 3,130
13 votes
2 answers
29k views

And in freemarker

Is it possible to have and(&&) in freemarker or do I have to use a nested if? <#if object?exists > </#if>
pethel's user avatar
  • 5,467
1 vote
4 answers
5k views

freemarker.runtime - Template processing error: "No mapping defined for http://www.springframework.org/security/tags"

Spring-security:3.0.2 Freemarker:2.3.19 I want to use springSecurity tags in freemarker, but it throws this errors: [16 14:10:46,349 ERROR] [btpool0-0] freemarker.runtime - Template processing ...
wade huang's user avatar
  • 1,485
0 votes
1 answer
370 views

Wicket 1.5 - Browser Pdf Print from freemaker template to byte[]

Im looking for a simple way to allow my application's user to print a PDF I generate after they click on a button. In the "onClick" of Button, I make some operation and then call a method like this ...
MrMime's user avatar
  • 685
11 votes
1 answer
32k views

accept-charset="UTF-8" parameter doesnt do anything, when used in form

I am using accept-charset="utf-8" attribute in form and found that the when do a form post with non-ascii, the headers have different accept charset option in the request header. Is there anything i ...
insomiac's user avatar
  • 5,654
1 vote
3 answers
2k views

How to have Freemarker use java.util.Date instead of org.mozilla.javascript.NativeDate in Alfresco?

This is probably a question for people close to Alfresco, as it is a bit specific. I have added a custom aspect to site on creation, and it holds a property of type date: <type>d:date</type&...
Zlatko's user avatar
  • 19.3k
4 votes
2 answers
9k views

Freemarker alternative[syntax] if condition with number

I am using alternative freemarker syntax(the one with square brackets). It works fine but I am not able to figure out how to use if condition to check if a number is greater than or less than. ...
Sandeep Nair's user avatar
  • 3,640
1 vote
1 answer
481 views

FreeMarker and JSP 2 tag files

I'm trying to use JSP 2 tags within a FreeMarker (2.3.19) template. In order to do that, I need to convert the following JSP 2 line: <%@ taglib prefix="pagestudio" tagdir="/WEB-INF/tags" %> ...
user1721398's user avatar
1 vote
2 answers
5k views

Switch Case in Freemarker : TemplateException

Here's my testMacro.txt <#macro myMacro value1 value2> <#list 1..value1 as x> <#if x=value1> <#switch value2> <#case value2 = 1> CASE1 ...
Kraken's user avatar
  • 23.9k
0 votes
1 answer
2k views

Changing value of a variable in the file to be imported; Freemarker

File testMacro.txt <#import "./importMe.txt" as my> <#assign a=0 > <@my.macro1 /> ${a} File importMe.txt <#macro macro1 > ${a} </#macro> Now from java file, when I ...
Kraken's user avatar
  • 23.9k
2 votes
1 answer
5k views

How to get JSON into a Freemarker Template (FTL)

I've got a MongoDB which I query and the result I serialize and this string I send to my ftl template. Below is the serialized result: [ { "id" : "10", ...
Steven Filipowicz's user avatar
0 votes
1 answer
977 views

MongoDB, Java and Freemarker Templates (FLT)

I'm working on this web project with: Java, MongoDB and Freemarker Templates (FTL) The data is sent to the FTL pages within a Map. Now I would like to know if it's possible to convert the result ...
Steven Filipowicz's user avatar
1 vote
1 answer
4k views

Importing freemarker macros

My macros.txt file is <#macro macro1> Helloworld. </#macro> I have another file testMacro.txt. I want to use this macro inside the file testMacro.txt. I have tried the following <#...
Kraken's user avatar
  • 23.9k
1 vote
1 answer
384 views

Add Hibernate Search Annotations with Hibernate tools

I'm using hibernate with annotations and hibernate tools with freemarker templates to automatically generate my orm dao classes. Now I'd like to implement hibernate search and therefor want to add ...
Pascal's user avatar
  • 2,004
37 votes
3 answers
53k views

How to check for null List in freemarker

Say my java code has List<String> listS =null and i pass this to my template file. Now i want to make sure that if list has some data then only do something. I have tried <#if listS = ...
Kraken's user avatar
  • 23.9k
0 votes
1 answer
2k views

How can I make a redirect page using just a button and jQuery-Freemarker?

I have a problem with a button that I want it to redirect to another page, I used the location.href but it didn't work also I've used the jQuery method $(location).attr('href','url') and nothing ...
Muhammad Bekette's user avatar
0 votes
0 answers
330 views

html select is off center when the page is loaded

i have a select on my page, and when the page loads the text that is initially displayed in the select box is not in the right spot, it is shifted down slightly. has anyone heard of this or seen this ...
Dagron's user avatar
  • 175
12 votes
1 answer
14k views

Alternatives to Freemarker when using Spring/Hibernate? [closed]

What are some modern, more-productive alternatives to Freemarker as view technology for rich web-applications using Spring? Is Spring MVC/Freemarker still one of the best combinations, or are there ...
egervari's user avatar
  • 22.4k
2 votes
1 answer
11k views

Cannot resolve template loader path Freemarker

I use freemarker with Spring. This is the way I configure my freemarker : <bean id="freemarkerConfiguration" class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean"> ...
Rudy's user avatar
  • 7,058
27 votes
3 answers
20k views

Freemarker: an enum in an if statement

In my if statement, I want to compare a variable, which is a JDK 1.5 enum, to an enum literal. For example: <#if type == ProblemStatisticType.BEST_SOLUTION_CHANGED> ... </#if> But I ...
Geoffrey De Smet's user avatar
2 votes
1 answer
6k views

Freemarker template exception

In my java code i create a List of A , and then add one instance of A to the list. I am passing this list to the freemarker template and my template code is as follows: <#if listA.size()!=0> &...
Kraken's user avatar
  • 23.9k
0 votes
1 answer
2k views

Freemarker: Dynamic interpolation of sub variables

I am trying to create a FreeMarker macro that can return the interpolation of a concatenation of a string and the input variable: <#macro findValue var> <#if (.vars["foo." + var]) ??> ...
AndersBaumann's user avatar
1 vote
1 answer
6k views

Freemarker if-else in list (scope)

In a list I want to incorporate a if host.machine == 1 then action=Set else action=Create I want the following output Type:Machine;Action:Set;Attributes[Name:machine1~NodeManager.ListenAddress:10.104....
ReneHH's user avatar
  • 25
1 vote
1 answer
308 views

URLDecode in dbsight in .ftl file

Can any one have any clue how to decode the %E3%82%A2%E3%82%AF%E3%82%A8%E3%83%AA%E3%82%A2%E3%83%B3%E3%82%A8%E3%82%A4%E3%82%B8 value in dbsight in .ftl file. Its in java.
JigneshMistry's user avatar
1 vote
1 answer
2k views

How to check whether two java objects are same or not in freemarker

I need to compare two java objects in freemarker whether both are same or not. is there any way to check equality of two java objects in freemarker
Sivaram Chintalapudi's user avatar
0 votes
1 answer
839 views

Freemarker rendering differently on IE8

we have a template that uses this for the record line <input type="${inputType}" name="${variableName}.code" id="${variable}.${vnum}.${answer.code}" class="checkbox" value="${answer.code}" ...
scphantm's user avatar
  • 4,413
1 vote
2 answers
872 views

How to overcome freemarker treeset sorting int keys alphabetically?

I have a TreeSet. The string key is actually a string value of an int, as freemarker doesn't allow ints as keys to maps, and as this is a sorted map, it sorts it as below: 1 10 11 12 2 3 4 5 6 7 8 ...
Ben Taliadoros's user avatar
2 votes
2 answers
1k views

Add properties to getter-annotations in Freemarker reverse engineering templates?

I am trying to implement a FreeMarker custom reverse engineering template that automatically creates my Hibernate classes. In the build process, the template is used by hibernate-tools to generate ...
Pascal's user avatar
  • 2,004
0 votes
1 answer
220 views

How to use a ${variable} as part of the hint/default in Netbeans code templates

I have something like the following in a Netbeans code template: /** * stuff */ $name = '${name}'; array('${var1 default="persons_${name}"}'); How can I make the default value for var1 actually ...
nicholas.alipaz's user avatar
0 votes
1 answer
5k views

Freemarker List inside a a table

I'm trying to generate a table with freemarker. <table class="timeline"> <tr> <#list children as child > <td class="timeline-item"><a ...
SpikerTom's user avatar
  • 125
1 vote
0 answers
415 views

Smooks GroovyContentHandlerFactory Exception when upgrading from 1.4 to 1.5.1?

I have recently upgraded my Smooks application from 1.4 to 1.5.1, but I keep getting the exception below: Error when processing EDI file org.milyn.cdr.SmooksConfigurationException: Error invoking @...
Matt Drake's user avatar
0 votes
0 answers
91 views

Generate 1 dto to another dto convertor using freemaker. Stuck at the generating enum type1 to enum type2 convertor

I am using freemaker to generate dto convertor from one type to another. Defining things through custom annotations E.g: @CustomAnnotationTargetDTO(type=DTO2) Class DTO1 { @...
S Kr's user avatar
  • 1,830
0 votes
2 answers
717 views

cmsfn.inherit() seems to return wrong type

In Magnolia 4.5.3, I'm trying to inherit a parent page's stage if none is defined for this. The Java class TemplatingFunctions (exposed as cmsfn in freemarker) provides a method inherit(Node content), ...
Cedric Reichenbach's user avatar
1 vote
1 answer
471 views

Freemarker Template with Struts framework

I am new to ftl and struts framework. I am trying to make index.ftl as welcome page and has mentioned it in web.xml. But when I'm running my project it is displayin error 403 that is access denied ...
jayati's user avatar
  • 83
2 votes
2 answers
7k views

JODReports freemarker 'if' with 'and' directive exception

I am using JODReports (http://jodreports.sourceforge.net/) in my project to generate documents. The problem is with 'AND' logical operation in '[#if...]' directives. Example (in '.odt' template): [#...
Arek Woźniak's user avatar
9 votes
3 answers
15k views

Adding spring library for usage of JSP Taglibs for security in Freemarker

I am using spring with freemarker as the template engine. Freemarker allows to use the Jsp Taglibs, for security for example, by adding <#assign security=JspTaglibs["http://www.springframework....
matthaeus's user avatar
  • 847
0 votes
1 answer
768 views

Using Freemarker templates and the JSF 2.x resources folder for media

I have a JSF 2.x application that sends emails using Freemarker templates. My problem is best described as follows: from my Freemarker template, I refer to a media/image that is hosted on the JSF ...
balteo's user avatar
  • 24.1k
0 votes
3 answers
21k views

How to put image on webpage using FTL(Free Markup Template Language)?

I am interested to know how can we put image using FTL (Free Markup Template Language) ? Also how to change font color & style in FTL? Can any1 knows any good learning tutorial of FTL? plz share ...
Prat's user avatar
  • 519
1 vote
2 answers
404 views

Dashlet edit button in titlebar not showing correctly

I am trying to create a simple Alfresco dashlet with an edit button enabled on the title bar. Unfortunately, I can not figure out how to get the edit button to actually display on the title bar. Here ...
Switch's user avatar
  • 15.1k
0 votes
0 answers
472 views

FreeMarker header and Page Breaks

I am using Free Marker API for text report, I have an requirement to prepare reports, with page breaks. Any Sample Needed. Sample Report header as Follows, how to achieve page 1 of 2. GP2602P ...
sridhar's user avatar
  • 51
0 votes
2 answers
2k views

Create variable number of buttons for an html form

I'm trying to make some changes to a questionnaire. Currently on each page there is an html form which has 3 submit buttons with values "next", "back", and "home". The value of the button gets passed ...
Paul Rubenstein's user avatar
15 votes
2 answers
12k views

freemarker functions vs macros

Hello freemarkers gurus I understand that the difference between freemarker functions and macros is that macros can print to the output, but cannot return values, while functions can return values ...
user1584078's user avatar
3 votes
3 answers
549 views

Repositioning the cursor with freemarker

I am working with free marker and java. I have to output result on a txt file. Say i have to print for 3 columns as `A B C` In the similar patter. All three attributes as string. Condition ...
user avatar
1 vote
1 answer
128 views

Representing string of length 4 in 8 character length

I am working with freemarker and i have value variable that holds string of variable length but less than 8. What i want to print it in 8 character spaces only. i.e ${value} should be spanned ...
user avatar
1 vote
1 answer
3k views

Configure a BeanWrapper for FreeMarker in Spring Web

<bean id="beansWrapper" class="freemarker.ext.beans.BeansWrapper"> <property name="exposeFields" value="true" /> </bean> <bean id="freemarkerConfig" class="org.springframework....
Alex Dow's user avatar
  • 628
2 votes
1 answer
2k views

Calling a non-bean property method in FreeMarker

In Freemarker we typically do stuff like this.. class User{ private String name; public String getName()... pubilc void setName(String name).... } Then our Freemarker code calls the property name ...
benstpierre's user avatar
  • 33.2k

1
51 52
53
54 55
62