]> git.mxchange.org Git - addressbook-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 11 Jun 2017 11:38:16 +0000 (13:38 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 11 Jun 2017 11:59:45 +0000 (13:59 +0200)
- 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

Signed-off-by: Roland Häder <roland@mxchange.org>
12 files changed:
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java
src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestController.java
src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java
src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java
src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestController.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java
web/WEB-INF/templates/guest/guest_menu.tpl
web/WEB-INF/web.xml

index 5199c5c8955960b044480f071450a59a00f2205e..9c3fad7eacf49f496bd655b3c6ee8057d60b30b3 100644 (file)
@@ -392,6 +392,7 @@ public interface AddressbookContactWebSessionController extends Serializable {
         * Setter for controller type
         * <p>
         * @param controllerType Controller type
+        * <p>
         * @deprecated Don't use this method.
         */
        @Deprecated
index 53c32e938b93fc4a4f1fa7a90095cf5b28641008..27547f514a9a697406f15140289e21f9b1ce2c45 100644 (file)
@@ -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.
         * <p>
         * @param contact Contact instance to link with existing/new data
         * <p>
@@ -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.
         * <p>
         * @param contact Contact instance to link with existing/new data
         * <p>
@@ -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.
         * <p>
         * @param contact Contact instance to link with existing/new data
         * <p>
index 8be57969578f38276f5ebf6c82bae8c08fe631ed..c36e6454614e20e450f0646efd634572a33a3937 100644 (file)
@@ -86,7 +86,7 @@ public interface AddressbookAdminCountryWebRequestController extends Serializabl
         * Setter for whether the local dial prefix is required for local calls
         * <p>
         * @param countryIsLocalPrefixRequired Whether the local dial prefix is
-        * required
+        *                                     required
         */
        void setCountryIsLocalPrefixRequired (final Boolean countryIsLocalPrefixRequired);
 
index 1e9c3879927bd4f74f480b4f6cb4456bac9374f6..3de5b295edd0c490c43eaa222b6b26f295a90884 100644 (file)
@@ -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;
        }
 
index b722f41e8d5349061e074a71f7dd79876a5e04bd..66e474b99ab3c83b11a531eee5acdb4f4e8b1e23 100644 (file)
@@ -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.
  * <p>
  * 1: http://www.mkyong.com/jsf2/jsf-2-internationalization-example/
  * <p>
index cf73143c519fecce7cdbb41214c06ec3b81b69c5..7fa835acb7014bb86ab8fcc06ecf75c2e9483645 100644 (file)
@@ -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;
 
index d2bbaa0b11d12241971ac5b0c3fce6954a870461..8dfc9a8bda32ca6a6bd9fc3c5bad7be068d726e7 100644 (file)
@@ -126,42 +126,42 @@ public interface AddressbookAdminPhoneWebRequestController extends Serializable
        /**
         * Getter for choosen fax number
         * <p>
-        * @return  fax number
+        * @return fax number
         */
        DialableFaxNumber getFaxNumber ();
 
        /**
         * Setter for choosen fax number
         * <p>
-        * @param choosenFaxNumber  fax number
+        * @param choosenFaxNumber fax number
         */
        void setFaxNumber (final DialableFaxNumber choosenFaxNumber);
 
        /**
         * Getter for choosen land-line number
         * <p>
-        * @return  land-line number
+        * @return land-line number
         */
        DialableLandLineNumber getLandLineNumber ();
 
        /**
         * Setter for choosen land-line number
         * <p>
-        * @param choosenLandLineNumber  land-line number
+        * @param choosenLandLineNumber land-line number
         */
        void setLandLineNumber (final DialableLandLineNumber choosenLandLineNumber);
 
        /**
         * Getter for choosen mobile number
         * <p>
-        * @return  mobile number
+        * @return mobile number
         */
        DialableMobileNumber getMobileNumber ();
 
        /**
         * Setter for choosen mobile number
         * <p>
-        * @param choosenMobileNumber  mobile number
+        * @param choosenMobileNumber mobile number
         */
        void setMobileNumber (final DialableMobileNumber choosenMobileNumber);
 
index 2a22b48938a6581b4bf38f58172bce16a0435ea4..73daf1ee3c54b833c841a41d275a9c4ec5df1cdf 100644 (file)
@@ -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) {
index 82c4af57dd81000693cab0d8ee00330292f37e15..0ce5269828ed6fc4ad85d6fb4d6d74d62aad8aba 100644 (file)
@@ -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;
        }
index 3b899c2309342f7fd2932ac1cbefe44bc4321f72..c2148e671a26974b4ca7a91db3cf079dd6bbc460 100644 (file)
@@ -96,7 +96,8 @@ public interface AddressbookUserWebSessionController extends Serializable {
         * <p>
         * @return User instance
         * <p>
-        * @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;
 
index 8453b9e3117ada439e627409013372dfe6117311..1bc058f8a534ab161d6d9259133583958a2ed1e6 100644 (file)
@@ -6,7 +6,7 @@
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
        <div class="menu_outer">
-               <h:outputText styleClass="menu">
+               <h:panelGroup styleClass="menu" layout="block">
                        <div class="menu_header">
                                <h:outputText value="#{msg.MENU_HOME_TITLE}" />
                        </div>
@@ -46,6 +46,6 @@
                                        </li>
                                </ui:fragment>
                        </ul>
-               </h:outputText>
+               </h:panelGroup>
        </div>
 </ui:composition>
index 4ecbfa0a2283d5d71e8cfc17fec6d70e3fc8afe7..202be2a571363710360c63155122b410cc84032f 100644 (file)
@@ -2,6 +2,11 @@
 <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
     <description>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.</description>
     <display-name>Addressbook Application v1.0</display-name>
+    <context-param>
+        <description>Whether the date converter's default timezone is system's timezone.</description>
+        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
+        <param-value>true</param-value>
+    </context-param>
     <context-param>
         <description>Whether the multi-page registration page or a single registration page is active</description>
         <param-name>is_feature_user_register_multiple_page_enabled</param-name>
         <param-name>is_feature_user_resend_confirmation_link_enabled</param-name>
         <param-value>true</param-value>
     </context-param>
-    <context-param>
-        <description>Whether default timezon is set from system's timezone</description>
-        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
-        <param-value>true</param-value>
-    </context-param>
     <context-param>
         <description>Whether registration page is enabled.</description>
         <param-name>is_feature_user_registration_enabled</param-name>
         <param-name>is_debug_register_enabled</param-name>
         <param-value>false</param-value>
     </context-param>
-    <context-param>
-        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
-        <param-value>true</param-value>
-    </context-param>
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>
         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>