1 package org.mycompany.newapp.modules.screens; 2 3 56 57 import java.util.HashMap ; 58 59 import org.apache.turbine.modules.Module; 60 import org.apache.turbine.TemplateContext; 61 import org.apache.turbine.RunData; 62 63 67 68 public class JGenTestScreen extends Module 69 { 70 protected void doBuildTemplate( RunData data, 71 TemplateContext context ) 72 throws Exception 73 { 74 context.put( "items", buildItemList() ); 75 } 76 77 public HashMap buildItemList() 78 { 79 HashMap map = new HashMap (); 80 81 map.put( "item1", new Item( "this", "is", "just" ) ); 82 map.put( "item2", new Item( "another", "silly", "test" ) ); 83 map.put( "item3", new Item( "i", "like", "f00d" ) ); 84 map.put( "item4", new Item( "f00d", "iz", "g00d" ) ); 85 86 return map; 87 } 88 89 92 public static class Item 93 { 94 private String value1; 95 private String value2; 96 private String value3; 97 98 public Item( String value1, String value2, String value3 ) 99 { 100 this.value1 = value1; 101 this.value2 = value2; 102 this.value3 = value3; 103 } 104 105 public String getValue1() 106 { 107 return value1; 108 } 109 110 public String getValue2() 111 { 112 return value2; 113 } 114 115 public String getValue3() 116 { 117 return value3; 118 } 119 } 120 } 121 | Popular Tags |