1 16 17 package examples.app1; 18 19 20 import javax.servlet.http.HttpServletRequest ; 21 import org.apache.struts.action.ActionError; 22 import org.apache.struts.action.ActionErrors; 23 import org.apache.struts.action.ActionForm; 24 import org.apache.struts.action.ActionMapping; 25 26 import java.util.Properties ; 27 28 29 35 36 public class AddressBean extends Object 37 { 38 39 40 private String firstname; 42 43 private String lastname; 44 45 private String street; 46 47 private String zip; 48 49 private String city; 50 51 private String country; 52 53 private String [] languages; 54 55 56 58 public String getFirstname() 59 { 60 return firstname; 61 62 } 63 64 public void setFirstname(String s) 65 { 66 firstname = s; 67 68 } 69 70 public String getLastname() 71 { 72 return lastname; 73 74 } 75 76 public void setLastname(String s) 77 { 78 lastname = s; 79 80 } 81 82 public String getStreet() 83 { 84 return street; 85 86 } 87 88 public void setStreet(String s) 89 { 90 street = s; 91 92 } 93 94 public String getZip() 95 { 96 return zip; 97 98 } 99 100 public void setZip(String s) 101 { 102 zip = s; 103 104 } 105 106 public String getCity() 107 { 108 return city; 109 110 } 111 112 public void setCity(String s) 113 { 114 city = s; 115 116 } 117 118 public String getCountry() 119 { 120 return country; 121 122 } 123 124 public void setCountry(String s) 125 { 126 country = s; 127 128 } 129 130 public String [] getLanguages() 131 { 132 return languages; 133 } 134 135 public void setLanguages(String [] languages) 136 { 137 this.languages = languages; 138 } 139 140 public Properties getLanguagesAsMap() 142 { 143 Properties p = new Properties (); 144 if (languages != null) 145 { 146 for (int i = 0; i < languages.length; i++) 147 p.setProperty((String )languages[i], "SELECTED"); 148 } 149 return p; 150 } 151 152 } 153 154 155 156 157 | Popular Tags |