]> git.mxchange.org Git - addressbook-war.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 07:11:18 +0000 (09:11 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 07:11:18 +0000 (09:11 +0200)
- return unmodifyable list instead of array
- use correct property name
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java
src/java/org/mxchange/addressbook/beans/country/CountryWebController.java
web/WEB-INF/templates/generic/form_personal_data.tpl

index 126a026750b2f380e93f82e34648da6e67a4fea0..b6b171ff99d4049e24f3fbddb381ea8e88a8464f 100644 (file)
@@ -16,6 +16,7 @@ package org.mxchange.addressbook.beans.country;
  * You should have received a copy of the GNU General Public License along with
  * this program. If not, see <http://www.gnu.org/licenses/>.
  */
+import java.util.Collections;
 import java.util.List;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
@@ -69,9 +70,9 @@ public class CountryWebBean implements CountryWebController {
        }
 
        @Override
-       public Country[] allCountries () {
+       public List<Country> allCountries () {
                // Return "cached" version
-               return (Country[]) this.countryList.toArray();
+               return Collections.unmodifiableList(this.countryList);
        }
 
        @PostConstruct
index b1a80240022b81b6cff6857a0b7c1941cef9b6a6..311af3bc65816057b774fe6c3d76ac03e89a86fc 100644 (file)
@@ -17,6 +17,7 @@ package org.mxchange.addressbook.beans.country;
  * this program. If not, see <http://www.gnu.org/licenses/>.
  */
 import java.io.Serializable;
+import java.util.List;
 import org.mxchange.jcountry.data.Country;
 
 /**
@@ -31,5 +32,5 @@ public interface CountryWebController extends Serializable {
         * <p>
         * @return All countries
         */
-       public Country[] allCountries ();
+       public List<Country> allCountries ();
 }
index fd33b3145963f60ba6b884c5c9c9a569153cd157..0d3b370340b71c778fbce500909748387feb4d62 100644 (file)
 
                                <div class="table_right">
                                        <h:selectOneMenu class="select" id="country" value="#{userController.country}">
-                                               <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{msg[c.messageKey]}" />
+                                               <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{msg[c.countryI18nkey]}" />
                                        </h:selectOneMenu>
                                </div>