From: Roland Häder Date: Wed, 27 Apr 2016 10:30:07 +0000 (+0200) Subject: added redirection outcomes to all "addFoo" methods X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=01e82975c7e8254872f5b015a20d3f7bde181936;p=jfinancials-war.git added redirection outcomes to all "addFoo" methods Signed-off-by: Roland Häder Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java index a3e5cad2..7ca34721 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java @@ -115,7 +115,7 @@ public class AddressbookAdminCountryWebRequestBean implements AddressbookAdminCo } @Override - public void addCountry () { + public String addCountry () { // Create new country object Country country = new CountryData(); @@ -146,6 +146,9 @@ public class AddressbookAdminCountryWebRequestBean implements AddressbookAdminCo // Fire event this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry)); + + // Redirect to list + return "admin_list_country"; //NOI18N } @Override diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java index 061baa46..56607fbe 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestController.java @@ -35,9 +35,12 @@ public interface AddressbookAdminCountryWebRequestController extends Serializabl List 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. + *

+ * @return Redirect outcome */ - void addCountry (); + String addCountry (); /** * Checks whether countries has been registered @@ -99,7 +102,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/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java index 78bd2d50..5b052c51 100644 --- a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java @@ -106,7 +106,7 @@ public class AddressbookAdminMobileProviderWebRequestBean implements Addressbook } @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 AddressbookAdminMobileProviderWebRequestBean implements Addressbook // Fire event this.providerAddedEvent.fire(new AdminMobileProviderAddedEvent(updatedProvider)); + + // Redirect to list + return "admin_list_mobile_provider"; //NOI18N } @Override diff --git a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestController.java b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestController.java index 081c7e0d..d287dd2b 100644 --- a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestController.java @@ -32,9 +32,11 @@ public interface AddressbookAdminMobileProviderWebRequestController extends Seri /** * 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. + *

+ * @return Redirect outcome */ - void addMobileProvider (); + String addMobileProvider (); /** * Returns a list of all mobile providers