]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
added redirection outcomes to all "addFoo" methods
authorRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 10:30:07 +0000 (12:30 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 Apr 2016 20:21:20 +0000 (22:21 +0200)
src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestController.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestController.java

index 9a1be70068396dae5da21be9f24dbdeb9b0c15d7..014bcbe6de59c883c22372348a07fb368b174486 100644 (file)
@@ -115,7 +115,7 @@ public class PizzaAdminCountryWebRequestBean implements PizzaAdminCountryWebRequ
        }
 
        @Override
-       public void addCountry () {
+       public String addCountry () {
                // Create new country object
                Country country = new CountryData();
 
@@ -146,6 +146,9 @@ public class PizzaAdminCountryWebRequestBean implements PizzaAdminCountryWebRequ
 
                // Fire event
                this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry));
+
+               // Redirect to list
+               return "admin_list_country"; //NOI18N
        }
 
        @Override
index 6422244986b664d74d2b7aa79bacffe9688c6cdc..d0e7d9f6335365d053d23424970fc96f2eb40d3a 100644 (file)
@@ -35,9 +35,12 @@ public interface PizzaAdminCountryWebRequestController extends Serializable {
        List<Country> allCountries ();
 
        /**
-        * Adds country to all relevant beans and sends it to the EJB.
+        * Adds country to all relevant beans and sends it to the EJB. A redirect
+        * should happen after successfull creation.
+        * <p>
+        * @return Redirect outcome
         */
-       void addCountry ();
+       String addCountry ();
 
        /**
         * Checks whether countries has been registered
index 465e5de6f6042e09e570db7a3cba3d2d0070eb58..1e587dc6387c50c5397774f5da6ac7865921f815 100644 (file)
@@ -106,7 +106,7 @@ public class PizzaAdminMobileProviderWebRequestBean implements PizzaAdminMobileP
        }
 
        @Override
-       public void addMobileProvider () {
+       public String addMobileProvider () {
                // Create mobile provider instance
                MobileProvider mobileProvider = new CellphoneProvider(this.getProviderDialPrefix(), this.getProviderName(), this.getProviderCountry(), this.getProviderMailPattern());
 
@@ -129,6 +129,9 @@ public class PizzaAdminMobileProviderWebRequestBean implements PizzaAdminMobileP
 
                // Fire event
                this.providerAddedEvent.fire(new AdminMobileProviderAddedEvent(updatedProvider));
+
+               // Redirect to list
+               return "admin_list_mobile_provider"; //NOI18N
        }
 
        @Override
index 558de55b55c8611989a26054cc9ddb95f3eebcd3..d3d340ace94b6f81a65a8a1a906cf511c23a61d7 100644 (file)
@@ -32,9 +32,11 @@ public interface PizzaAdminMobileProviderWebRequestController extends Serializab
        /**
         * Adds a mobile provider to database by calling the EJB. A pre-check on
         * dial-prefix and country combination is done, if found, an exception is
-        * thrown.
+        * thrown. A redirect should take place after successfull creation.
+        * <p>
+        * @return Redirect outcome
         */
-       void addMobileProvider ();
+       String addMobileProvider ();
 
        /**
         * Returns a list of all mobile providers