From: Roland Haeder <roland@mxchange.org>
Date: Tue, 8 Sep 2015 20:43:34 +0000 (+0200)
Subject: Continued:
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f8cd5b9be11ea52dfc0a8c6fb685f3ec2bfe0189;p=jcoreee.git

Continued:
- removed more JSP-stuff (servlet filter)
- don't extend BaseFrameworkSystem in POJOs or FrameworkInterface in POJIs ... :-(
- Logging won't work as there is a severe message in logfile
- updated jcore.jar
Signed-off-by:Roland Häder <roland@mxchange.org>
---

diff --git a/lib/jcore-ee-logger.jar b/lib/jcore-ee-logger.jar
index b7c4751..4869b92 100644
Binary files a/lib/jcore-ee-logger.jar and b/lib/jcore-ee-logger.jar differ
diff --git a/lib/jcore.jar b/lib/jcore.jar
index 7318d47..217c364 100644
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
diff --git a/src/org/mxchange/jcoreee/BaseEeSystem.java b/src/org/mxchange/jcoreee/BaseEeSystem.java
new file mode 100644
index 0000000..c71dcd5
--- /dev/null
+++ b/src/org/mxchange/jcoreee/BaseEeSystem.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcoreee;
+
+import java.util.ResourceBundle;
+import javax.inject.Inject;
+import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
+
+/**
+ *
+ * @author Roland Haeder
+ */
+public class BaseEeSystem {
+	/**
+	 * Bundle instance
+	 */
+	private ResourceBundle bundle;
+
+	/**
+	 * Logger instance
+	 */
+	@Inject
+	private LoggerBeanLocal logger;
+
+	/**
+	 * Getter for message from given key
+	 *
+	 * @param key Key to get message from
+	 * @return Message
+	 */
+	protected String getMessageStringFromKey (final String key) {
+		// Return message
+		return this.getBundle().getString(key);
+	}
+
+	/**
+	 * Getter for local bean logger
+	 *
+	 * @return Local bean logger
+	 */
+	protected LoggerBeanLocal getLogger () {
+		return this.logger;
+	}
+
+	/**
+	 * Getter for bundle instance
+	 *
+	 * @return Bundle instance
+	 */
+	private ResourceBundle getBundle () {
+		return this.bundle;
+	}
+}
diff --git a/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java b/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
index 0aa4843..508eed2 100644
--- a/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
+++ b/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
@@ -17,7 +17,7 @@
 package org.mxchange.jcoreee.beans;
 
 import java.io.Serializable;
-import org.mxchange.jcoree.BaseEeSystem;
+import org.mxchange.jcoreee.BaseEeSystem;
 
 /**
  * A general bean class. Do not put things in here that are not serializable.
diff --git a/src/org/mxchange/jcoreee/filter/servlet/BaseServletFilter.java b/src/org/mxchange/jcoreee/filter/servlet/BaseServletFilter.java
deleted file mode 100644
index b7656c0..0000000
--- a/src/org/mxchange/jcoreee/filter/servlet/BaseServletFilter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcoreee.filter.servlet;
-
-import java.text.MessageFormat;
-import javax.servlet.Filter;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import org.mxchange.jcoree.BaseEeSystem;
-
-/**
- * A general servlet filter class. If you need to override init() or
- * destroy() please always call the super method first and handle over all
- * parameter.
- *
- * @author Roland Haeder
- */
-public abstract class BaseServletFilter extends BaseEeSystem implements Filter {
-	/**
-	 * Configuration instance
-	 */
-	private FilterConfig config;
-
-	/**
-	 * Destroys this filter
-	 */
-	@Override
-	public void destroy () {
-		// Unset config instance
-		this.setConfig(null);
-	}
-
-	/**
-	 * Initializes this filter
-	 *
-	 * @param filterConfig Filter configuration
-	 * @throws ServletException 
-	 */
-	@Override
-	public void init (final FilterConfig filterConfig) throws ServletException {
-		// Trace message
-		this.getLogger().logTrace(MessageFormat.format("filterConfig={0} - CALLED!", filterConfig)); //NOI18N
-
-		// Set config instance
-		this.setConfig(filterConfig);
-
-		// Trace message
-		this.getLogger().logTrace("EXIT!"); //NOI18N
-	}
-
-	/**
-	 * Configuration instance
-	 * @return the config
-	 */
-	protected FilterConfig getConfig () {
-		return this.config;
-	}
-
-	/**
-	 * Configuration instance
-	 * @param config the config to set
-	 */
-	private void setConfig (final FilterConfig config) {
-		this.config = config;
-	}
-}
diff --git a/src/org/mxchange/jcoreee/filter/servlet/utf8/Utf8ServletFilter.java b/src/org/mxchange/jcoreee/filter/servlet/utf8/Utf8ServletFilter.java
deleted file mode 100644
index 4e53964..0000000
--- a/src/org/mxchange/jcoreee/filter/servlet/utf8/Utf8ServletFilter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcoreee.filter.servlet.utf8;
-
-import java.io.IOException;
-import java.text.MessageFormat;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import org.mxchange.jcoreee.filter.servlet.BaseServletFilter;
-
-/**
- * A HTTP filter for setting UTF-8 character encoding.
- *
- * @author Roland Haeder
- */
-public class Utf8ServletFilter extends BaseServletFilter implements Filter {
-	/**
-	 * Filter to set UTF-8 encoding
-	 *
-	 * @param request ServletRequest instance
-	 * @param response ServletResponse instance
-	 * @param chain FilterChain instance
-	 * @throws IOException
-	 * @throws ServletException
-	 */
-	@Override
-	public void doFilter (final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
-		// Trace message
-		this.getLogger().logTrace(MessageFormat.format("request={0},response={1},chain={2} - CALLED!", request, response, chain)); //NOI18N
-
-		// Call super method
-		chain.doFilter(request, response);
-
-		// Set response/request both to UTF-8
-		request.setCharacterEncoding("UTF-8"); //NOI18N
-		response.setCharacterEncoding("UTF-8"); //NOI18N
-
-		// Trace message
-		this.getLogger().logTrace("EXIT!"); //NOI18N
-	}
-}
diff --git a/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java b/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
index 67e5508..64daca0 100644
--- a/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
+++ b/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
@@ -23,7 +23,7 @@ import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.Validator;
 import javax.faces.validator.ValidatorException;
-import org.mxchange.jcoree.BaseEeSystem;
+import org.mxchange.jcoreee.BaseEeSystem;
 
 /**
  * A general object validation class. Please implement javax.faces.validator.Validator
@@ -85,7 +85,7 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida
 					errKey = String.format("error.%s.is_null", field); //NOI18N
 
 					// Value it null
-					facesMessage = new FacesMessage(BaseEeSystem.getMessageStringFromKey(errKey));
+					facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
 				}
 
 				// Abort here
diff --git a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
index 194686a..fc661bc 100644
--- a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
+++ b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
@@ -25,7 +25,6 @@ import javax.faces.component.ValueHolder;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.Validator;
 import javax.faces.validator.ValidatorException;
-import org.mxchange.jcoree.BaseEeSystem;
 import org.mxchange.jcoreee.validator.BaseObjectValidator;
 
 /**
@@ -58,7 +57,7 @@ public abstract class BaseBooleanValidator extends BaseObjectValidator implement
 				// Compare value's type
 				if (!(value instanceof Boolean)) {
 					// Value is not right type
-					facesMessage = new FacesMessage(BaseEeSystem.getMessageStringFromKey(String.format("error.%s.is_not_boolean", field))); //NOI18N
+					facesMessage = new FacesMessage(getMessageStringFromKey(String.format("error.%s.is_not_boolean", field))); //NOI18N
 					break;
 				}
 
diff --git a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
index 83dc8a6..65056d4 100644
--- a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
+++ b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
@@ -22,7 +22,6 @@ import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.ValidatorException;
-import org.mxchange.jcoree.BaseEeSystem;
 import org.mxchange.jcoreee.validator.BaseObjectValidator;
 
 /**
@@ -58,7 +57,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator {
 					// Value is empty
 					errKey = String.format("error.%s.is_not_string", field); //NOI18N
 
-					facesMessage = new FacesMessage(BaseEeSystem.getMessageStringFromKey(errKey));
+					facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
 				}
 
 				// Cast to string
@@ -69,7 +68,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator {
 					// Value is empty
 					errKey = String.format("error.%s.is_empty", field); //NOI18N
 
-					facesMessage = new FacesMessage(BaseEeSystem.getMessageStringFromKey(errKey));
+					facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
 				}
 			}
 		}