struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r517026 - in /struts/struts2/branches/STRUTS_2_0_X/apps/mailreader: pom.xml src/main/java/applicationContext.xml src/main/java/mailreader2/MailreaderSupport.java src/main/webapp/WEB-INF/web.xml
Date Sun, 11 Mar 2007 21:58:50 GMT
Author: husted
Date: Sun Mar 11 14:58:50 2007
New Revision: 517026

URL: http://svn.apache.org/viewvc?view=rev&rev=517026
Log:
WW-1801 Remove Spring dependency by copying properties manually. 


Removed:
    struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/java/applicationContext.xml
Modified:
    struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/pom.xml
    struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java
    struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/webapp/WEB-INF/web.xml

Modified: struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/pom.xml
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/pom.xml?view=diff&rev=517026&r1=517025&r2=517026
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/pom.xml (original)
+++ struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/pom.xml Sun Mar 11 14:58:50 2007
@@ -31,11 +31,6 @@
            <artifactId>struts-mailreader-dao</artifactId>
            <version>1.3.5</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.struts</groupId>
-            <artifactId>struts2-spring-plugin</artifactId>
-            <version>${pom.version}</version>
-        </dependency>
     </dependencies>
 
     <build>

Modified: struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java?view=diff&rev=517026&r1=517025&r2=517026
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java
Sun Mar 11 14:58:50 2007
@@ -32,8 +32,6 @@
 import org.apache.struts.apps.mailreader.dao.UserDatabase;
 import org.apache.struts.apps.mailreader.dao.impl.memory.MemorySubscription;
 import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUser;
-import org.springframework.beans.BeanUtils;
-
 import java.util.Map;
 
 /**
@@ -63,6 +61,28 @@
         return Constants.CANCEL;
     }
 
+    /**
+     * Convenience method to copy User properties.
+     **/
+    protected void copyUser(User source, User target) {
+      if ((source==null) || (target==null)) return;
+      target.setFromAddress(source.getFromAddress());
+      target.setFullName(source.getFullName());
+      target.setPassword(source.getPassword());
+      target.setReplyToAddress(source.getReplyToAddress());
+    }
+
+    /**
+     * Convenience method to copy Subscription properties.
+     **/
+    protected void copySubscription(Subscription source, Subscription target) {
+      if ((source==null) || (target==null)) return;
+      target.setAutoConnect(source.getAutoConnect());
+      target.setPassword(source.getPassword());
+      target.setType(source.getType());
+      target.setUsername(source.getUsername());
+    }
+
 
     // ---- ApplicationAware ----
 
@@ -435,7 +455,7 @@
         input.setPassword(_password);
         User user = createUser(_username, _password);
         if (null != user) {
-            BeanUtils.copyProperties(input,user);
+            copyUser(input,user);
             setUser(user);
         }
     }
@@ -532,7 +552,7 @@
         Subscription input = getSubscription();
         Subscription sub = createSubscription(host);
         if (null != sub) {
-            BeanUtils.copyProperties(input, sub);
+            copySubscription(input, sub);
             setSubscription(sub);
             setHost(sub.getHost());
         }

Modified: struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/webapp/WEB-INF/web.xml?view=diff&rev=517026&r1=517025&r2=517026
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/webapp/WEB-INF/web.xml (original)
+++ struts/struts2/branches/STRUTS_2_0_X/apps/mailreader/src/main/webapp/WEB-INF/web.xml Sun
Mar 11 14:58:50 2007
@@ -4,11 +4,6 @@
 
     <display-name>Struts 2 Mailreader</display-name>
 
-    <context-param>
-        <param-name>contextConfigLocation</param-name>
-        <param-value>classpath*:applicationContext*.xml</param-value>
-    </context-param>
-
     <filter>
         <filter-name>Struts2</filter-name>
         <filter-class>
@@ -21,19 +16,13 @@
         <url-pattern>/*</url-pattern>
     </filter-mapping>
 
-    <listener>
-        <listener-class>
-            org.springframework.web.context.ContextLoaderListener
-        </listener-class>
-    </listener>
-
     <!-- Application Listener for Mailreader database -->
     <listener>
         <listener-class>
             mailreader2.ApplicationListener
         </listener-class>
     </listener>
-       
+
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>



Mime
View raw message