Skip to content

Commit 39b1e6d

Browse files
committed
updates
1 parent bddd114 commit 39b1e6d

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

com.vogella.freemarker.first/src/com/vogella/freemarker/first/MainTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static void main(String[] args) {
1919
// Configuration
2020
Writer file = null;
2121
Configuration cfg = new Configuration();
22-
22+
2323
try {
2424
// Set Directory for templates
2525
cfg.setDirectoryForTemplateLoading(new File("templates"));
@@ -32,12 +32,13 @@ public static void main(String[] args) {
3232
input.put("container", "test");
3333

3434
// create list
35-
List<String> systems = new ArrayList<String>();
36-
systems.add("Android");
37-
systems.add("iOS States");
38-
systems.add("Ubuntu");
39-
systems.add("Windows7");
40-
systems.add("OS/2");
35+
List<ValueExampleObject> systems = new ArrayList<ValueExampleObject>();
36+
37+
systems.add(new ValueExampleObject("Android"));
38+
systems.add(new ValueExampleObject("iOS States"));
39+
systems.add(new ValueExampleObject("Ubuntu"));
40+
systems.add(new ValueExampleObject("Windows7"));
41+
systems.add(new ValueExampleObject("OS/2"));
4142

4243
input.put("systems", systems);
4344

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.vogella.freemarker.first;
2+
3+
public class ValueExampleObject {
4+
5+
private String name;
6+
7+
public ValueExampleObject(String name) {
8+
super();
9+
this.name = name;
10+
}
11+
12+
public String getName() {
13+
return name;
14+
}
15+
16+
public void setName(String name) {
17+
this.name = name;
18+
}
19+
20+
}

com.vogella.freemarker.first/templates/helloworld.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<ul>
99
<#list systems as system>
10-
<li>${system_index + 1}. ${system}</li>
10+
<li>${system_index + 1}.${system.getName()}</li>
1111
</#list>
1212
</ul>
1313

0 commit comments

Comments
 (0)