struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r438524 - in /struts/struts2/trunk/apps/mailreader/src/main: java/ java/mailreader2/ webapp/pages/
Date Wed, 30 Aug 2006 15:46:33 GMT
Author: husted
Date: Wed Aug 30 08:46:32 2006
New Revision: 438524

URL: http://svn.apache.org/viewvc?rev=438524&view=rev
Log:
WW-1349 MailReader: Minor refactorings to optimize use of wildcard DMI. 

Added:
    struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml
      - copied, changed from r438500, struts/struts2/trunk/apps/mailreader/src/main/java/struts-support.xml
    struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-support.xml
      - copied, changed from r438500, struts/struts2/trunk/apps/mailreader/src/main/java/struts-wildcard.xml
    struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration-Registration!save-validation.xml
      - copied unchanged from r438522, struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration-RegistrationSave-validation.xml
Removed:
    struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration-RegistrationSave-validation.xml
    struts/struts2/trunk/apps/mailreader/src/main/java/struts-bang.xml
    struts/struts2/trunk/apps/mailreader/src/main/java/struts-support.xml
    struts/struts2/trunk/apps/mailreader/src/main/java/struts-wildcard.xml
Modified:
    struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration.java
    struts/struts2/trunk/apps/mailreader/src/main/java/struts.xml
    struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Registration.jsp
    struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Subscription.jsp

Copied: struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml (from r438500,
struts/struts2/trunk/apps/mailreader/src/main/java/struts-support.xml)
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml?p2=struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml&p1=struts/struts2/trunk/apps/mailreader/src/main/java/struts-support.xml&r1=438500&r2=438524&rev=438524&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/src/main/java/struts-support.xml (original)
+++ struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-default.xml Wed Aug 30 08:46:32
2006
@@ -5,7 +5,7 @@
 
 <struts>
 
-    <package name="struts-support" namespace="/" extends="struts-default">
+    <package name="mailreader-default" namespace="/" extends="struts-default">
 
         <interceptors>
 
@@ -46,28 +46,6 @@
                     result="error"
                     exception="java.lang.Throwable"/>
         </global-exception-mappings>
-
-        <action name="Welcome" class="mailreader2.Welcome">
-            <result>/pages/Welcome.jsp</result>
-            <interceptor-ref name="guest"/>
-        </action>
-
-        <action name="ChangePassword" class="mailreader2.MailreaderSupport">
-            <result>/pages/ChangePassword.jsp</result>
-        </action>
-
-        <action name="MainMenu" class="mailreader2.MailreaderSupport">
-            <result>/pages/MainMenu.jsp</result>
-        </action>
-
-        <action name="Logoff" class="mailreader2.Logoff">
-            <result type="redirect-action">Welcome</result>
-        </action>
-
-        <action name="Tour">
-            <result>/pages/tour.html</result>
-            <interceptor-ref name="guest"/>
-        </action>
 
     </package>
 

Copied: struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-support.xml (from r438500,
struts/struts2/trunk/apps/mailreader/src/main/java/struts-wildcard.xml)
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-support.xml?p2=struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-support.xml&p1=struts/struts2/trunk/apps/mailreader/src/main/java/struts-wildcard.xml&r1=438500&r2=438524&rev=438524&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/src/main/java/struts-wildcard.xml (original)
+++ struts/struts2/trunk/apps/mailreader/src/main/java/mailreader-support.xml Wed Aug 30 08:46:32
2006
@@ -4,7 +4,21 @@
     "http://struts.apache.org/dtds/struts-2.0.dtd">
 
 <struts>
-    <package name="wildcard" namespace="/" extends="struts-support">
+    <package name="mailreader-support" namespace="/" extends="mailreader-default">
+
+        <action name="Tour">
+            <result>/pages/tour.html</result>
+            <interceptor-ref name="guest"/>
+        </action>
+
+        <action name="Welcome" class="mailreader2.Welcome">
+            <result>/pages/Welcome.jsp</result>
+            <interceptor-ref name="guest"/>
+        </action>
+
+        <action name="Logoff" class="mailreader2.Logoff">
+            <result type="redirect-action">Welcome</result>
+        </action>
 
         <action name="Logon!*" class="mailreader2.Logon" method="{1}">
             <result name="input">/pages/Logon.jsp</result>
@@ -23,22 +37,20 @@
             <interceptor-ref name="guest"/>
         </action>
 
-        <action name="RegistrationSave" class="mailreader2.Registration">
-            <result name="input">/pages/Registration.jsp</result>
-            <result type="redirect-action">MainMenu</result>
-            <interceptor-ref name="guest-submit" />
-        </action>
-
-        <action name="Subscription!*" class="mailreader2.Subscription" method="{1}">
+        <action name="Subscription!save" class="mailreader2.SubscriptionSave">
             <result name="input">/pages/Subscription.jsp</result>
             <result type="redirect-action">Registration!input</result>
+            <interceptor-ref name="user-submit" />
         </action>
 
-        <action name="SubscriptionSave" class="mailreader2.SubscriptionSave">
+        <action name="Subscription!*" class="mailreader2.Subscription" method="{1}">
             <result name="input">/pages/Subscription.jsp</result>
             <result type="redirect-action">Registration!input</result>
-            <interceptor-ref name="user-submit" />
         </action>
 
+        <action name="*" class="mailreader2.MailreaderSupport">
+            <result>/pages/{1}.jsp</result>
+        </action>
+        
     </package>
 </struts>

Modified: struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration.java?rev=438524&r1=438523&r2=438524&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration.java (original)
+++ struts/struts2/trunk/apps/mailreader/src/main/java/mailreader2/Registration.java Wed Aug
30 08:46:32 2006
@@ -40,12 +40,22 @@
     }
 
     /**
+     * <p>Insert or update a Registration.</p>
+     *
+     * @return The "outcome" result code
+     * @throws Exception on any error
+     */
+    public String save() throws Exception {
+        return execute();
+    }
+
+    /**
      * <p> Insert or update a User object to the persistent store. </p>
      * <p/>
      * <p> If a User is not logged in, then a new User is created and
      * automatically logged in. Otherwise, the existing User is updated. </p>
      *
-     * @return The "Success" result for this mapping
+     * @return The "outcome" result code
      * @throws Exception on any error
      */
     public String execute()

Modified: struts/struts2/trunk/apps/mailreader/src/main/java/struts.xml
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/java/struts.xml?rev=438524&r1=438523&r2=438524&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/src/main/java/struts.xml (original)
+++ struts/struts2/trunk/apps/mailreader/src/main/java/struts.xml Wed Aug 30 08:46:32 2006
@@ -7,11 +7,8 @@
 
     <include file="struts-default.xml"/>
 
-    <include file="struts-support.xml"/>
+    <include file="mailreader-default.xml"/>
 
-    <!--
-    <include file="struts-bang.xml"/>
-    -->
-    <include file="struts-wildcard.xml"/>
+    <include file="mailreader-support.xml"/>
 
 </struts>

Modified: struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Registration.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Registration.jsp?rev=438524&r1=438523&r2=438524&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Registration.jsp (original)
+++ struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Registration.jsp Wed Aug 30
08:46:32 2006
@@ -17,7 +17,7 @@
 <body onLoad="self.focus();document.Registration.username.focus()">
 
 <s:actionerror/>
-<s:form action="RegistrationSave" validate="false">
+<s:form action="Registration!save" validate="false">
     <s:token />
     <s:hidden name="task"/>
     <s:if test="task == 'Create'">
@@ -42,7 +42,7 @@
                    name="user.replyToAddress"/>
 
     <s:if test="task == 'Create'">
-        <s:submit value="%{getText('button.save')}" action="RegistrationSave"/>
+        <s:submit value="%{getText('button.save')}" action="Registration!save"/>
 
         <s:reset value="%{getText('button.reset')}"/>
 

Modified: struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Subscription.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Subscription.jsp?rev=438524&r1=438523&r2=438524&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Subscription.jsp (original)
+++ struts/struts2/trunk/apps/mailreader/src/main/webapp/pages/Subscription.jsp Wed Aug 30
08:46:32 2006
@@ -20,7 +20,7 @@
 <body onLoad="self.focus();document.Subscription.username.focus()">
 
 <s:actionerror/>
-<s:form action="SubscriptionSave" validate="false">
+<s:form action="Subscription!save" validate="false">
     <s:token />
     <s:hidden name="task"/>
     <s:label label="%{getText('username')}" name="user.username"/>



Mime
View raw message