From 7df96f7b90b9dda087ddd16b13ec0eac54157aa9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 27 Apr 2016 12:30:07 +0200 Subject: [PATCH] added redirection outcomes to all "addFoo" methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder Signed-off-by: Roland Häder --- .../beans/country/JobsAdminCountryWebRequestBean.java | 5 ++++- .../country/JobsAdminCountryWebRequestController.java | 9 ++++++--- .../JobsAdminMobileProviderWebRequestBean.java | 5 ++++- .../JobsAdminMobileProviderWebRequestController.java | 6 ++++-- 4 files changed, 18 insertions(+), 7 deletions(-) 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 -- 2.39.5