]> git.mxchange.org Git - jfinancials-war.git/commitdiff
cleanup from JSTL:
authorRoland Haeder <roland@mxchange.org>
Tue, 20 Oct 2015 10:40:20 +0000 (12:40 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 20 Oct 2015 10:40:20 +0000 (12:40 +0200)
- removed all JSTL usages as this mixes JSF with JSTL which more belongs to JSP
- used f:setPropertyActionListener to set the currently used user instance in profileController.user
- sorry that there is still ui:fragment around but I don't like/want overlong expressions in rendered attributes
- better throw IllegalStateException and not quietly return false in isOwnAddressbook() this method should only work when the user is logged-in
- improved some exception text

Signed-off-by:Roland Häder <roland@mxchange.org>

14 files changed:
src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebSessionBean.java
src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java
web/imprint.xhtml
web/index.xhtml
web/login/login_shared_addressbooks.xhtml
web/login/login_start_sharing_addressbook.xhtml
web/privacy.xhtml
web/terms.xhtml
web/user/login.xhtml
web/user/lost_passwd.xhtml
web/user/register.xhtml
web/user/register_done.xhtml
web/user/show_addressbook.xhtml
web/user/user_list.xhtml

index cfc167ddd32dfecd25c14b262feca1217298a17d..eb4dee33e9a3ea4e6fad828c25b817fba7adae60 100644 (file)
@@ -397,7 +397,7 @@ public class AddressbookWebSessionBean implements AddressbookWebSessionControlle
                // Is the user logged in?
                if (!this.loginController.isUserLoggedIn()) {
                        // No, then no own address book
-                       return false;
+                       throw new IllegalStateException("isOwnAddressbook() has been invoked for a guest account"); //NOI18N
                }
 
                // Is same user?
index 3dd30eb62e64ed5732e64463619b95a8a95915ef..a150320a0ffe07efb39da9934eac2aa9c6ebe065 100644 (file)
@@ -178,7 +178,7 @@ public class UserLoginWebSessionBean implements UserLoginWebSessionController {
                // Check on login
                if (!this.isUserLoggedIn()) {
                        // Not logged in!
-                       throw new IllegalStateException("isInvisible() was called for guest."); //NOI18N
+                       throw new IllegalStateException("isInvisible() has been invoked for a guest."); //NOI18N
                }
 
                // Check logged-in first, then invisibility
index 5f18036a3458d4765d95984d7a109ca216f7e454..e5cd571521f3c45f7927e52b445ba4a43af6c12b 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index 60403707f5a3aeab9bc5246f613289d089519024..1af56cbbbd0a5fd43527c1b7562031a30a0a1188 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index 8ce811db9c6545b415c17d7865f1c55a3a5aa35c..358a591096731f2457dc90088b7aac23ca094fd7 100644 (file)
@@ -33,7 +33,7 @@
                                                <h:column>
                                                        <f:facet name="header">#{msg.SHAREE_USER_NAME}</f:facet>
                                                        <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
-                                                               <ui:param name="user" value="#{share.shareUserSharee}" />
+                                                               <f:setPropertyActionListener target="#{share.shareUserSharee}" value="#{profileController.user}" />
                                                        </ui:include>
                                                </h:column>
 
index 6704fb30ffaa8be9740d07bc802f4d6d3203b9c6..2f152fe19326d35594aeacc159761ca26679e9ad 100644 (file)
@@ -3,9 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:f="http://xmlns.jcp.org/jsf/core"
-
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
+         xmlns:f="http://xmlns.jcp.org/jsf/core">
 
        <ui:composition template="/WEB-INF/templates/#{loginController.templateType}/#{loginController.templateType}_base.tpl">
                <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_START_SHARING_ADDRESSBOOK}</ui:define>
@@ -22,6 +20,8 @@
                                </div>
 
                                <div class="para">
+                                       <h:outputText id="ownProfileInvisible" class="notice" value="#{msg.USER_NOT_LOGGED_IN}" rendered="#{not loginController.isUserLoggedIn()}" />
+
                                        <h:dataTable id="userList" headerClass="table_header_column" var="user" value="#{addressbookController.allUsersNotSharing()}" rendered="#{loginController.isUserLoggedIn() and not loginController.isInvisible()}">
                                                <f:setPropertyActionListener target="#{user}" value="#{profileController.user}" />
                                                <h:column>
@@ -32,7 +32,7 @@
                                                <h:column>
                                                        <f:facet name="header">#{msg.USER_NAME}</f:facet>
                                                        <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
-                                                               <ui:param name="user" value="#{user}" />
+                                                               <f:setPropertyActionListener target="#{user}" value="#{profileController.user}" />
                                                        </ui:include>
                                                </h:column>
 
@@ -44,9 +44,7 @@
                                                </h:column>
                                        </h:dataTable>
 
-                                       <h:outputText id="ownProfileInvible" class="notice" value="#{msg.USER_NOT_LOGGED_IN}" rendered="#{not loginController.isUserLoggedIn()}" />
-
-                                       <h:outputText id="ownProfileInvible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" />
+                                       <h:outputText id="ownProfileInvisible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" rendered="#{loginController.isUserLoggedIn() and not loginController.isInvisible()}" />
                                </div>
 
                                <div class="table_footer">
index 3cadc9eefbc76cab554b7beb5d71e86ca9f464f9..235c0e64addf778365e028e3fcbf3fca64018ce4 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index ee1a6ac46fa15cefa8b962f27a8ad38ebe1250e9..ba7d66db9e7a62257d079bbdd59528fcb898cd0a 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index 35ffa1eb576e765268070bb9ebc98473e9681627..7f4a55a8bcdff84dce87ea88b1fcdb00d84f9e50 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index 8374947d5f7081c37d7cfe2267808815b38ba7b1..0fbc9e65ab806dff236854a4a3583f1ce4c685dc 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index 3eb5b69521efdd115761271179de69a8718520ce..bc6d5120e8f1b062aab9a0cb72671ed6ff962b2b 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index 1c177b65f2a632d831f225292df20cd6e445a05f..18b2d49392d3b4bbc0cfa0bef2fe2208038f0f49 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          >
 
index 15c3b5a327d55ee7118b5b3d4e7cc8375fe8ac9f..9c980d8b3712bc1b55f28b18bd4309d2640e6053 100644 (file)
@@ -3,8 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:f="http://xmlns.jcp.org/jsf/core"
-         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
+         xmlns:f="http://xmlns.jcp.org/jsf/core">
 
        <f:metadata>
                <f:viewParam id="addressbookId" name="addressbookId" value="#{addressbookController.addressbookId}" required="true" requiredMessage="#{msg.PARAMETER_ADDRESSBOOK_ID_MISSING}" converterMessage="#{msg.PARAMETER_ADDRESSBOOK_ID_INVALID}" validatorMessage="#{msg.PARAMETER_ADDRESSBOOK_ID_NOT_FOUND}">
@@ -33,7 +32,7 @@
 
                                <h:outputLabel for="userProfileLink" class="table_label">#{msg.ADDRESSBOOK_OWNER}</h:outputLabel>
                                <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
-                                       <ui:param name="user" value="#{addressbookController.addressbookUser}" />
+                                       <f:setPropertyActionListener target="#{addressbookController.addressbookUser}" value="#{profileController.user}" />
                                </ui:include>
 
                                <h:outputLabel for="addressbookCreated" class="table_label">#{msg.ADDRESSBOOK_CREATED}</h:outputLabel>
                                <h:outputText id="addressbookStatus" value="#{msg[addressbookController.addressbook.addressbookStatus.messageKey]}" title="#{msg.ADDRESSBOOK_STATUS_TITLE}" />
 
                                <f:facet name="footer">
-                                       <c:choose>
-                                               <c:when test="#{loginController.isUserLoggedIn() and not loginController.isInvisible()}">
-                                                       <c:choose>
-                                                               <c:when test="#{addressbookController.isOwnAddressbook()}">
-                                                                       <h:link id="startSharing" outcome="login_start_sharing_addressbook" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE}" />
-                                                               </c:when>
+                                       <h:outputText id="ownProfileInvible" class="notice" value="#{msg.USER_NOT_LOGGED_IN}" rendered="#{not loginController.isUserLoggedIn()}" />
+                                       <h:outputText id="ownProfileInvible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" rendered="#{loginController.isUserLoggedIn() and loginController.isInvisible()}" />
 
-                                                               <c:when test="#{addressbookController.isOtherAddressbook()}">
-                                                                       Bla bla
-                                                               </c:when>
-                                                       </c:choose>
-                                               </c:when>
-                                               <c:when test="#{not loginController.isUserLoggedIn()}">
-                                                       <h:outputText id="ownProfileInvible" class="notice" value="#{msg.USER_NOT_LOGGED_IN}" />
-                                               </c:when>
-                                               <c:otherwise>
-                                                       <h:outputText id="ownProfileInvible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" />
-                                               </c:otherwise>
-                                       </c:choose>
+                                       <ui:fragment rendered="#{loginController.isUserLoggedIn() and not loginController.isInvisible()}">
+                                               <h:link id="startSharing" outcome="login_start_sharing_addressbook" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE}" rendered="#{addressbookController.isOwnAddressbook()}" />
+
+                                               <h:outputText value="Bla bla" rendered="#{addressbookController.isOtherAddressbook()}" />
+                                       </ui:fragment>
                                </f:facet>
                        </h:panelGrid>
                </ui:define>
index 4e78e200271e52fec8b987ed0565bbc8e08da63b..8a08d31dbf629a4ad6fe0a8d10da985d640cc3f0 100644 (file)
                                        <h:column>
                                                <f:facet name="header">#{msg.USER_ID}</f:facet>
                                                <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
-                                                       <ui:param name="user" value="#{user}" />
+                                                       <f:setPropertyActionListener target="#{user}" value="#{profileController.user}" />
                                                </ui:include>
                                        </h:column>
 
                                        <h:column>
                                                <f:facet name="header">#{msg.USER_NAME}</f:facet>
                                                <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
-                                                       <ui:param name="user" value="#{user}" />
+                                                       <f:setPropertyActionListener target="#{user}" value="#{profileController.user}" />
                                                </ui:include>
                                        </h:column>