]> git.mxchange.org Git - jfinancials-war.git/commitdiff
init() doesn't work with guests, so forbid it here + used address book instance from...
authorRoland Haeder <roland@mxchange.org>
Fri, 16 Oct 2015 11:36:30 +0000 (13:36 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 16 Oct 2015 11:36:30 +0000 (13:36 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/addressbook/beans/shares/SharesWebBean.java
web/login/login_shared_addressbooks.xhtml

index 288e4c4a3dea9cc92b5899cbd3f0d1a48511c4b7..bfb768d3fbe611ff3210c5da77bd57161a32858a 100644 (file)
@@ -185,6 +185,12 @@ public class SharesWebBean implements SharesWebController {
 
        @PostConstruct
        public void init () {
+               // Check conditions
+               if (!this.loginController.isUserLoggedIn()) {
+                       // No, then throw exception
+                       throw new FaceletException("This method can only be called as logged-in user."); //NOI18N
+               }
+
                // Init share list
                this.sharedAddressbooks = this.shareBean.allSharedAddressbooks(this.loginController.getLoggedInUser());
        }
index ed84ff920dddde521c4fad2fb1cef54a9ffb899a..2f6ba09a02f71437f31ba7ce78847bf420d52cbd 100644 (file)
@@ -25,7 +25,7 @@
                                                        <f:facet name="header">#{msg.SHARED_ADDRESSBOOK}</f:facet>
 
                                                        <h:link outcome="login_show_addressbook" title="#{msg.LINK_LOGIN_SHOW_ADDRESS_BOOK_TITLE}">
-                                                               <f:param name="addressbook_id" value="#{addressbook.addressbookId}" />
+                                                               <f:param name="addressbook_id" value="#{share.shareAddressbook.addressbookId}" />
                                                                <h:outputText id="addressbookName" value="#{share.shareAddressbook.addressbookName}" title="#{msg.SHARED_ADDRESSBOOK_TITLE}" />
                                                        </h:link>
                                                </h:column>