From ca18098fa3f79f0083f899eded399cc2bc903201 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 11 Jun 2017 13:38:16 +0200 Subject: [PATCH] Please cherry-pick: - h:outputText was wrong where it should be h:panelGroup, now the guest menue is being shown again - feature controller is no longer causing and then catching NPE (bad code style) - sorted web.xml - reformated some files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ...ddressbookContactWebSessionController.java | 1 + ...AdminContactPhoneWebRequestController.java | 13 +++++----- ...sbookAdminCountryWebRequestController.java | 2 +- .../AddressbookFeatureWebApplicationBean.java | 15 ++++++------ .../AddressbookLocalizationSessionBean.java | 4 ++-- .../AddressbookAdminPhoneWebRequestBean.java | 6 ++--- ...essbookAdminPhoneWebRequestController.java | 12 +++++----- .../AddressbookPhoneWebApplicationBean.java | 24 +++++++++---------- .../user/AddressbookUserWebSessionBean.java | 3 --- .../AddressbookUserWebSessionController.java | 3 ++- web/WEB-INF/templates/guest/guest_menu.tpl | 4 ++-- web/WEB-INF/web.xml | 14 ++++------- 12 files changed, 47 insertions(+), 54 deletions(-) diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java index 5199c5c8..9c3fad7e 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java @@ -392,6 +392,7 @@ public interface AddressbookContactWebSessionController extends Serializable { * Setter for controller type *

* @param controllerType Controller type + *

* @deprecated Don't use this method. */ @Deprecated diff --git a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestController.java b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestController.java index 53c32e93..27547f51 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestController.java @@ -51,8 +51,8 @@ public interface AddressbookAdminContactPhoneWebRequestController extends Serial String unlinkMobileContactData (); /** - * Links given contact instance with set fax number or entered data. If - * both is set, a proper exception is thrown as this is an invalid state. + * Links given contact instance with set fax number or entered data. If both + * is set, a proper exception is thrown as this is an invalid state. *

* @param contact Contact instance to link with existing/new data *

@@ -61,9 +61,8 @@ public interface AddressbookAdminContactPhoneWebRequestController extends Serial String doLinkAddFaxNumber (final Contact contact); /** - * Links given contact instance with set land-line number or entered - * data. If both is set, a proper exception is thrown as this is an invalid - * state. + * Links given contact instance with set land-line number or entered data. + * If both is set, a proper exception is thrown as this is an invalid state. *

* @param contact Contact instance to link with existing/new data *

@@ -72,8 +71,8 @@ public interface AddressbookAdminContactPhoneWebRequestController extends Serial String doLinkAddLandLineNumber (final Contact contact); /** - * Links given contact instance with set mobile or entered data. If both - * is set, a proper exception is thrown as this is an invalid state. + * Links given contact instance with set mobile or entered data. If both is + * set, a proper exception is thrown as this is an invalid state. *

* @param contact Contact instance to link with existing/new data *

diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java index 8be57969..c36e6454 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java @@ -86,7 +86,7 @@ public interface AddressbookAdminCountryWebRequestController extends Serializabl * Setter for whether the local dial prefix is required for local calls *

* @param countryIsLocalPrefixRequired Whether the local dial prefix is - * required + * required */ void setCountryIsLocalPrefixRequired (final Boolean countryIsLocalPrefixRequired); diff --git a/src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java b/src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java index 1e9c3879..3de5b295 100644 --- a/src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java +++ b/src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java @@ -64,18 +64,17 @@ public class AddressbookFeatureWebApplicationBean extends BaseAddressbookControl // Default is not enabled boolean isEnabled = false; - // Try it as an NPE may come - try { - // Get value from property - String value = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N + // Get value from property + String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N + //System.out.println(MessageFormat.format("isFeatureSet: feature={0},contextParameter[]={1}", feature, Objects.toString(contextParameter))); //NOI18N + // Is the context parameter found? + if (contextParameter instanceof String) { // Is it set? - isEnabled = (value.toLowerCase().equals("true")); //NOI18N - } catch (final NullPointerException ex) { - // Ignored + isEnabled = (Boolean.parseBoolean(contextParameter) == Boolean.TRUE); } - // Return value + // Return status return isEnabled; } diff --git a/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java b/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java index b722f41e..66e474b9 100644 --- a/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java @@ -28,8 +28,8 @@ import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent; import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent; /** - * A session-scoped bean for handling localization/internationalization changes. This - * class is based on an example at [1] from mkyong. + * A session-scoped bean for handling localization/internationalization changes. + * This class is based on an example at [1] from mkyong. *

* 1: http://www.mkyong.com/jsf2/jsf-2-internationalization-example/ *

diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java index cf73143c..7fa835ac 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java @@ -87,17 +87,17 @@ public class AddressbookAdminPhoneWebRequestBean extends BaseAddressbookControll private AddressbookWebRequestHelperController beanHelper; /** - * fax number + * fax number */ private DialableFaxNumber choosenFaxNumber; /** - * land-line number + * land-line number */ private DialableLandLineNumber choosenLandLineNumber; /** - * mobile number + * mobile number */ private DialableMobileNumber choosenMobileNumber; diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestController.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestController.java index d2bbaa0b..8dfc9a8b 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestController.java @@ -126,42 +126,42 @@ public interface AddressbookAdminPhoneWebRequestController extends Serializable /** * Getter for choosen fax number *

- * @return fax number + * @return fax number */ DialableFaxNumber getFaxNumber (); /** * Setter for choosen fax number *

- * @param choosenFaxNumber fax number + * @param choosenFaxNumber fax number */ void setFaxNumber (final DialableFaxNumber choosenFaxNumber); /** * Getter for choosen land-line number *

- * @return land-line number + * @return land-line number */ DialableLandLineNumber getLandLineNumber (); /** * Setter for choosen land-line number *

- * @param choosenLandLineNumber land-line number + * @param choosenLandLineNumber land-line number */ void setLandLineNumber (final DialableLandLineNumber choosenLandLineNumber); /** * Getter for choosen mobile number *

- * @return mobile number + * @return mobile number */ DialableMobileNumber getMobileNumber (); /** * Setter for choosen mobile number *

- * @param choosenMobileNumber mobile number + * @param choosenMobileNumber mobile number */ void setMobileNumber (final DialableMobileNumber choosenMobileNumber); diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java index 2a22b489..73daf1ee 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java @@ -148,7 +148,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getDeletedFaxNumber()== null) { + } else if (event.getDeletedFaxNumber() == null) { // Throw NPE again throw new NullPointerException("event.deletedFaxNumber is null"); //NOI18N } else if (event.getDeletedFaxNumber().getPhoneId() == null) { @@ -172,7 +172,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getDeletedLandLineNumber()== null) { + } else if (event.getDeletedLandLineNumber() == null) { // Throw NPE again throw new NullPointerException("event.deletedLandLineNumber is null"); //NOI18N } else if (event.getDeletedLandLineNumber().getPhoneId() == null) { @@ -196,7 +196,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getDeletedMobileNumber()== null) { + } else if (event.getDeletedMobileNumber() == null) { // Throw NPE again throw new NullPointerException("event.deletedMobileNumber is null"); //NOI18N } else if (event.getDeletedMobileNumber().getPhoneId() == null) { @@ -228,7 +228,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle throw new NullPointerException("event.contact.contactId is null"); } else if (event.getContact().getContactId() < 1) { // Throw again ... - throw new NullPointerException("event.contact.contactId="+ event.getContact().getContactId() + " is invalid"); + throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid"); } else if (event.getContact().getContactFaxNumber() == null) { // Throw again ... throw new NullPointerException("event.contact.contactFaxNumber is null"); @@ -237,7 +237,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle throw new NullPointerException("event.contact.contactFaxNumber.phoneId is null"); } else if (event.getContact().getContactFaxNumber().getPhoneId() < 1) { // Throw again ... - throw new NullPointerException("event.contact.contactFaxNumber.phoneId="+event.getContact().getContactFaxNumber().getPhoneId() + " is invalid"); + throw new NullPointerException("event.contact.contactFaxNumber.phoneId=" + event.getContact().getContactFaxNumber().getPhoneId() + " is invalid"); } else if (event.getLinkedFaxNumber() == null) { // Throw again ... throw new NullPointerException("event.linkedFaxNumer is null"); @@ -264,7 +264,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle throw new NullPointerException("event.contact.contactId is null"); } else if (event.getContact().getContactId() < 1) { // Throw again ... - throw new NullPointerException("event.contact.contactId="+ event.getContact().getContactId() + " is invalid"); + throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid"); } else if (event.getContact().getContactLandLineNumber() == null) { // Throw again ... throw new NullPointerException("event.contact.contactLandLineNumber is null"); @@ -273,7 +273,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle throw new NullPointerException("event.contact.contactLandLineNumber.phoneId is null"); } else if (event.getContact().getContactLandLineNumber().getPhoneId() < 1) { // Throw again ... - throw new NullPointerException("event.contact.contactLandLineNumber.phoneId="+event.getContact().getContactLandLineNumber().getPhoneId() + " is invalid"); + throw new NullPointerException("event.contact.contactLandLineNumber.phoneId=" + event.getContact().getContactLandLineNumber().getPhoneId() + " is invalid"); } else if (event.getLinkedLandLineNumber() == null) { // Throw again ... throw new NullPointerException("event.linkedLandLineNumer is null"); @@ -300,7 +300,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle throw new NullPointerException("event.contact.contactId is null"); } else if (event.getContact().getContactId() < 1) { // Throw again ... - throw new NullPointerException("event.contact.contactId="+ event.getContact().getContactId() + " is invalid"); + throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid"); } else if (event.getContact().getContactMobileNumber() == null) { // Throw again ... throw new NullPointerException("event.contact.contactMobileNumber is null"); @@ -309,7 +309,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle throw new NullPointerException("event.contact.contactMobileNumber.phoneId is null"); } else if (event.getContact().getContactMobileNumber().getPhoneId() < 1) { // Throw again ... - throw new NullPointerException("event.contact.contactMobileNumber.phoneId="+event.getContact().getContactMobileNumber().getPhoneId() + " is invalid"); + throw new NullPointerException("event.contact.contactMobileNumber.phoneId=" + event.getContact().getContactMobileNumber().getPhoneId() + " is invalid"); } else if (event.getLinkedMobileNumber() == null) { // Throw again ... throw new NullPointerException("event.linkedMobileNumer is null"); @@ -352,7 +352,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getUpdatedFaxNumber()== null) { + } else if (event.getUpdatedFaxNumber() == null) { // Throw NPE again throw new NullPointerException("event.updatedFaxNumber is null"); //NOI18N } else if (event.getUpdatedFaxNumber().getPhoneId() == null) { @@ -376,7 +376,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getUpdatedLandLineNumber()== null) { + } else if (event.getUpdatedLandLineNumber() == null) { // Throw NPE again throw new NullPointerException("event.updatedLandLineNumber is null"); //NOI18N } else if (event.getUpdatedLandLineNumber().getPhoneId() == null) { @@ -400,7 +400,7 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getUpdatedMobileNumber()== null) { + } else if (event.getUpdatedMobileNumber() == null) { // Throw NPE again throw new NullPointerException("event.updatedMobileNumber is null"); //NOI18N } else if (event.getUpdatedMobileNumber().getPhoneId() == null) { diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java index 82c4af57..0ce52698 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java @@ -530,14 +530,12 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp // Debug message //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: contact={1}", this.getClass().getSimpleName(), contact)); - // Set contact in user user.setUserContact(contact); } // Trace message //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: user={1} - EXIT!", this.getClass().getSimpleName(), user)); - // Return it return user; } @@ -564,7 +562,6 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp // Trace message //* NOISY-DEBUG */ System.out.println(MessageFormat.format("{0}.createUserLogin: user={1} - EXIT!", this.getClass().getSimpleName(), user)); - // Return the new instance return user; } diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java index 3b899c23..c2148e67 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java @@ -96,7 +96,8 @@ public interface AddressbookUserWebSessionController extends Serializable { *

* @return User instance *

- * @throws UserEmailAddressNotFoundException If the user's email address is not found + * @throws UserEmailAddressNotFoundException If the user's email address is + * not found */ User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException; diff --git a/web/WEB-INF/templates/guest/guest_menu.tpl b/web/WEB-INF/templates/guest/guest_menu.tpl index 8453b9e3..1bc058f8 100644 --- a/web/WEB-INF/templates/guest/guest_menu.tpl +++ b/web/WEB-INF/templates/guest/guest_menu.tpl @@ -6,7 +6,7 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 4ecbfa0a..202be2a5 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -2,6 +2,11 @@ An online address book application to share private and business memebers between all members. It is also possible that the user's profile can be made visible to outside. Addressbook Application v1.0 + + Whether the date converter's default timezone is system's timezone. + javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE + true + Whether the multi-page registration page or a single registration page is active is_feature_user_register_multiple_page_enabled @@ -17,11 +22,6 @@ is_feature_user_resend_confirmation_link_enabled true - - Whether default timezon is set from system's timezone - javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE - true - Whether registration page is enabled. is_feature_user_registration_enabled @@ -117,10 +117,6 @@ is_debug_register_enabled false - - javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE - true - Faces Servlet javax.faces.webapp.FacesServlet -- 2.39.5