2 * Copyright (C) 2016 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.pizzaapplication.beans.localization;
19 import java.util.Locale;
20 import javax.annotation.PostConstruct;
21 import javax.faces.bean.SessionScoped;
22 import javax.faces.context.FacesContext;
23 import javax.inject.Named;
24 import org.mxchange.jcoreee.database.BaseDatabaseBean;
27 * A session bean for handling localization/internationalization changes. This
28 * class is based on an example at [1] from mkyong.
30 * 1: http://www.mkyong.com/jsf2/jsf-2-internationalization-example/
32 * @author Roland Haeder<roland@mxchange.org>
34 @Named ("localization")
36 public class PizzaLocalizationSessionBean extends BaseDatabaseBean implements LocalizationSessionController {
41 private static final long serialVersionUID = 1_867_671_657_629_601_528L;
46 private Locale locale;
49 public Locale getLocale () {
54 public void setLocale (final Locale locale) {
59 * Initializer for this bean
63 // Create locale instance from context
64 Locale loc = FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();