Author: husted Date: Sun Mar 11 15:18:07 2007 New Revision: 517032 URL: http://svn.apache.org/viewvc?view=rev&rev=517032 Log: WW-1801 Remove Spring dependency by copying properties manually. WW-1707 Update interceptor reference.
Removed: struts/struts2/trunk/apps/mailreader/src/main/java/applicationContext.xml Modified: struts/struts2/trunk/apps/mailreader/pom.xml struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/web.xml Modified: struts/struts2/trunk/apps/mailreader/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/pom.xml?view=diff&rev=517032&r1=517031&r2=517032 ============================================================================== --- struts/struts2/trunk/apps/mailreader/pom.xml (original) +++ struts/struts2/trunk/apps/mailreader/pom.xml Sun Mar 11 15:18:07 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/trunk/apps/mailreader/src/main/java/mailreader-default.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml?view=diff&rev=517032&r1=517031&r2=517032 ============================================================================== --- struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml (original) +++ struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml Sun Mar 11 15:18:07 2007 @@ -18,7 +18,7 @@ </interceptor-stack> <interceptor-stack name="user-submit" > - <interceptor-ref name="token-session" /> + <interceptor-ref name="tokenSession" /> <interceptor-ref name="user"/> </interceptor-stack> Modified: struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java?view=diff&rev=517032&r1=517031&r2=517032 ============================================================================== --- struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java (original) +++ struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/MailreaderSupport.java Sun Mar 11 15:18:07 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/trunk/apps/mailreader/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/web.xml?view=diff&rev=517032&r1=517031&r2=517032 ============================================================================== --- struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/web.xml (original) +++ struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/web.xml Sun Mar 11 15:18:07 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>