File tree Expand file tree Collapse file tree 3 files changed +29
-8
lines changed
com.vogella.freemarker.first
src/com/vogella/freemarker/first Expand file tree Collapse file tree 3 files changed +29
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments