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=7df96f7b90b9dda087ddd16b13ec0eac54157aa9;p=jjobs-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/jjobs/beans/country/JobsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java index f8441a22..ed3beb6d 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java @@ -115,7 +115,7 @@ public class JobsAdminCountryWebRequestBean implements JobsAdminCountryWebReques } @Override - public void addCountry () { + public String addCountry () { // Create new country object Country country = new CountryData(); @@ -146,6 +146,9 @@ public class JobsAdminCountryWebRequestBean implements JobsAdminCountryWebReques // Fire event this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry)); + + // Redirect to list + return "admin_list_country"; //NOI18N } @Override diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestController.java b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestController.java index f0ab5012..9ea1d2a2 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestController.java @@ -35,9 +35,12 @@ public interface JobsAdminCountryWebRequestController extends Serializable { 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 JobsAdminCountryWebRequestController extends Serializable { * 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/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java index 55c1808d..a432548b 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java @@ -106,7 +106,7 @@ public class JobsAdminMobileProviderWebRequestBean implements JobsAdminMobilePro } @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 JobsAdminMobileProviderWebRequestBean implements JobsAdminMobilePro // 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/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestController.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestController.java index dbaabefa..7e380bdc 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestController.java @@ -32,9 +32,11 @@ public interface JobsAdminMobileProviderWebRequestController extends Serializabl /** * 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