let us start using struts
authoridfx <idfx>
Fri, 5 Sep 2003 20:17:36 +0000 (20:17 +0000)
committeridfx <idfx>
Fri, 5 Sep 2003 20:17:36 +0000 (20:17 +0000)
etc/struts-config.xml [new file with mode: 0755]
etc/web.xml

diff --git a/etc/struts-config.xml b/etc/struts-config.xml
new file mode 100755 (executable)
index 0000000..4b94619
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>\r
+\r
+<!DOCTYPE struts-config PUBLIC\r
+          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"\r
+          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">\r
+\r
+<!--\r
+     This is the Struts configuration file for the example application,\r
+     using the proposed new syntax.\r
+-->\r
+\r
+\r
+<struts-config>\r
+\r
+\r
+  <!-- ========== Data Source Configuration =============================== -->\r
+<!--\r
+ <data-sources>\r
+   <data-source>\r
+     <set-property property="autoCommit"\r
+                      value="false"/>\r
+     <set-property property="description"\r
+                      value="Example Data Source Configuration"/>\r
+     <set-property property="driverClass"\r
+                      value="org.postgresql.Driver"/>\r
+     <set-property property="maxCount"\r
+                      value="4"/>\r
+     <set-property property="minCount"\r
+                      value="2"/>\r
+     <set-property property="password"\r
+                      value="mypassword"/>\r
+     <set-property property="url"\r
+                      value="jdbc:postgresql://localhost/mydatabase"/>\r
+     <set-property property="user"\r
+                      value="myusername"/>\r
+   </data-source>\r
+ </data-sources>\r
+-->\r
+  <!-- ========== Form Bean Definitions =================================== -->\r
+  <form-beans>\r
+\r
+    <!-- Logon form bean -->\r
+    <form-bean       name="logonForm"\r
+                     type="org.apache.struts.validator.DynaValidatorForm">\r
+      <form-property name="username" type="java.lang.String"/>\r
+      <form-property name="password" type="java.lang.String"/>\r
+    </form-bean>\r
+\r
+  <!-- ========== Global Forward Definitions ============================== -->\r
+  <global-forwards>\r
+    <forward   name="logoff"               path="/admin/logout.do"/>\r
+    <forward   name="logon"                path="/admin/login.shtml"/>\r
+    <forward   name="success"              path="/admin/index.shtml"/>\r
+  </global-forwards>\r
+\r
+\r
+  <!-- ========== Action Mapping Definitions ============================== -->\r
+  <action-mappings>\r
+    <!-- Process a user logoff -->\r
+    <action    path="/logoff"\r
+               type="mir.core.ui.action.AuthenticationAction">\r
+      <forward name="success" path="/index.shtml"/>\r
+    </action>\r
+\r
+    <!-- Process a user logon -->\r
+    <action    path="/logon"\r
+               type="mir.core.ui.action.AuthenticationAction"\r
+               name="logonForm"\r
+              scope="session"\r
+              input="logon">\r
+      <exception\r
+                key="expired.password"\r
+               type="org.apache.struts.webapp.example.ExpiredPasswordException"\r
+               path="/changePassword.jsp"/>\r
+    </action>\r
+  </action-mappings>\r
+\r
+\r
+  <!-- ========== Controller Configuration ================================ -->\r
+\r
+  <controller>\r
+    <!-- The "input" parameter on "action" elements is the name of a\r
+         local or global "forward" rather than a module-relative path -->\r
+    <set-property property="inputForward" value="true"/>\r
+  </controller>\r
+\r
+\r
+  <!-- ========== Message Resources Definitions =========================== -->\r
+\r
+  <!-- ========== Plug Ins Configuration ================================== -->\r
+\r
+  <plug-in className="mir.core.ui.plugin.HibernatePlugin">\r
+    <!--\r
+    <set-property property="pathname" value="/WEB-INF/database.xml"/>\r
+    -->\r
+  </plug-in>\r
+</struts-config>\r
index 42b5798..db47a25 100755 (executable)
@@ -1,10 +1,30 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 
 <!DOCTYPE web-app
-    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
-    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 <web-app>
+
+       <servlet>
+               <servlet-name>presentation</servlet-name>
+               <servlet-class>mir.core.ui.servlet.TemplateServlet</servlet-class>
+       </servlet>
+       <servlet-mapping>
+               <servlet-name>presentation</servlet-name>
+               <url-pattern>*.shtml</url-pattern>
+       </servlet-mapping>
+       
+       <servlet>
+               <servlet-name>action</servlet-name>
+               <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
+        <init-param>
+               <param-name>config</param-name>
+               <param-value>/WEB-INF/etc/struts-config.xml</param-value>
+        </init-param>
+               <load-on-startup>1</load-on-startup>
+       </servlet>
+       
     <servlet>
         <servlet-name>
             Mir
         <url-pattern>/servlet/OpenMir</url-pattern>
     </servlet-mapping>
 
+       <filter>
+               <filter-name>authentication</filter-name>
+               <filter-class>mir.core.ui.filter.AuthenticationFilter</filter-class>    
+       </filter>
+       
+       <filter-mapping>
+               <filter-name>authentication</filter-name>
+               <servlet-name>presentation</servlet-name>
+       </filter-mapping>
     <mime-mapping>
       <extension>
         mp3 
         application/pdf
       </mime-type>
     </mime-mapping>
-
-    <security-constraint>
-      <web-resource-collection>
-         <web-resource-name>Protected Area</web-resource-name>
-        <!-- Define the context-relative URL(s) to be protected -->
-         <url-pattern>/jsp/security/protected/*</url-pattern>
-        <!-- If you list http methods, only those methods are protected -->
-        <http-method>DELETE</http-method>
-         <http-method>GET</http-method>
-         <http-method>POST</http-method>
-        <http-method>PUT</http-method>
-      </web-resource-collection>
-      <auth-constraint>
-         <!-- Anyone with one of the listed roles may access this area -->
-         <role-name>tomcat</role-name>
-        <role-name>role1</role-name>
-      </auth-constraint>
-    </security-constraint>
-
-    <!-- Default login configuration uses BASIC authentication -->
-    <!--
-    <login-config>
-      <auth-method>BASIC</auth-method>
-      <realm-name>Example Basic Authentication Area</realm-name>
-    </login-config>
-    -->
-
-    <!-- Form-based login is enabled by default.  If you wish to
-         try Basic authentication, comment out the <login-config>
-         section below and uncomment the one above. -->
-    <login-config>
-      <auth-method>FORM</auth-method>
-      <realm-name>Example Form-Based Authentication Area</realm-name>
-      <form-login-config>
-        <form-login-page>/jsp/security/login/login.jsp</form-login-page>
-        <form-error-page>/jsp/security/login/error.jsp</form-error-page>
-      </form-login-config>
-    </login-config>
-
-</web-app>
+</web-app>
\ No newline at end of file