changeset 4:72951b955f00

Basic Struts-Infrastructur Added gnv/trunk@73 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 11 Sep 2009 15:21:58 +0000
parents d7b4a77ba892
children 4027821ca8d7
files gnv/Changelog gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java gnv/src/main/webapp/WEB-INF/config/struts-config.xml gnv/src/main/webapp/WEB-INF/jsp/index.jsp
diffstat 5 files changed, 125 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/Changelog	Fri Sep 11 15:19:52 2009 +0000
+++ b/gnv/Changelog	Fri Sep 11 15:21:58 2009 +0000
@@ -1,3 +1,11 @@
+2009-09-11  Tim Englich  <tim.englich@intevation.de>
+
+    * src/main/webapp/WEB-INF/jsp/index.jsp Added , 
+      src/main/webapp/WEB-INF/config/struts-config.xml Added,  
+      src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Added
+      src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Added:
+      Basic Struts-Infrastructur Added 
+      
 2009-09-11  Tim Englich  <tim.englich@intevation.de>
 
     * src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Added, 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java	Fri Sep 11 15:21:58 2009 +0000
@@ -0,0 +1,57 @@
+/**
+ *
+ */
+package de.intevation.gnv.action;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+/**
+ * @author Tim Englich <tim.englich@intevation.de>
+ *
+ */
+public class ArtifactDatabaseActionBase extends Action {
+
+    /**
+     * the logger, used to log exceptions and additonaly information
+     */
+    private static Logger log = Logger.getLogger(ArtifactDatabaseActionBase.class);
+    
+    /**
+     * Constructor
+     */
+    public ArtifactDatabaseActionBase() {
+        super();
+    }
+
+    /**
+     * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+     */
+    @Override
+    public ActionForward execute(ActionMapping mapping, ActionForm form,
+            HttpServletRequest request, HttpServletResponse response)
+            throws Exception {
+            log.debug("ArtifactDatabaseActionBase.execute 1");
+            return super.execute(mapping, form, request, response);
+    }
+
+    /**
+     * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)
+     */
+    @Override
+    public ActionForward execute(ActionMapping mapping, ActionForm form,
+            ServletRequest request, ServletResponse response) throws Exception {
+            log.debug("ArtifactDatabaseActionBase.execute 2");
+            return super.execute(mapping, form, request, response);
+    }
+
+ 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java	Fri Sep 11 15:21:58 2009 +0000
@@ -0,0 +1,38 @@
+/*
+ * 
+ */
+package de.intevation.gnv.servlet;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.ActionServlet;
+
+import de.intevation.gnv.propertiesreader.PropertiesReaderFactory;
+
+/**
+ * 
+ * @author Tim Englich <tim.englich@intevation.de>
+ *
+ */
+public class GNVActionServlet extends ActionServlet {
+    /**
+     * the logger, used to log exceptions and additonaly information
+     */
+    private static Logger log = Logger.getLogger(GNVActionServlet.class);
+
+    /**
+     * The UID of this Class
+     */
+    private static final long serialVersionUID = 3597396283436383943L;
+
+    /**
+     * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig)
+     */
+    public void init(ServletConfig config) throws ServletException {
+        super.init(config);
+        log.info("PropertiesReader will be configured.");
+        PropertiesReaderFactory.getInstance().initPropertiesReader(config);
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Fri Sep 11 15:21:58 2009 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE struts-config PUBLIC
+        "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
+        "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
+<struts-config>
+    <global-exceptions/>
+    <global-forwards>
+        <forward name="noSession" path="/start.do"/>
+    </global-forwards>
+    <action-mappings>
+    	<action path="/test.do" type="de.intevation.gnv.action.ArtifactDatabaseActionBase">
+            <description>General Forward</description>
+            <forward name="noSession" path="/WEB-INF/jsp/index.jsp"/>
+        </action>
+       </action-mappings>
+</struts-config>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/index.jsp	Fri Sep 11 15:21:58 2009 +0000
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>

http://dive4elements.wald.intevation.org