mirror of
https://github.com/apache/struts.git
synced 2026-08-06 15:17:00 +00:00
WW-1349 MailReader: Minor refactorings to optimize use of wildcard DMI.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@438524 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+1
-23
@@ -5,7 +5,7 @@
|
||||
|
||||
<struts>
|
||||
|
||||
<package name="struts-support" namespace="/" extends="struts-default">
|
||||
<package name="mailreader-default" namespace="/" extends="struts-default">
|
||||
|
||||
<interceptors>
|
||||
|
||||
@@ -47,28 +47,6 @@
|
||||
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>
|
||||
|
||||
</struts>
|
||||
+22
-10
@@ -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,10 +37,10 @@
|
||||
<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 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="Subscription!*" class="mailreader2.Subscription" method="{1}">
|
||||
@@ -34,11 +48,9 @@
|
||||
<result type="redirect-action">Registration!input</result>
|
||||
</action>
|
||||
|
||||
<action name="SubscriptionSave" class="mailreader2.SubscriptionSave">
|
||||
<result name="input">/pages/Subscription.jsp</result>
|
||||
<result type="redirect-action">Registration!input</result>
|
||||
<interceptor-ref name="user-submit" />
|
||||
<action name="*" class="mailreader2.MailreaderSupport">
|
||||
<result>/pages/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
@@ -39,13 +39,23 @@ public class Registration extends MailreaderSupport {
|
||||
return INPUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <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()
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="bang" namespace="/" extends="struts-support">
|
||||
|
||||
<action name="Logon" class="mailreader2.Logon">
|
||||
<result name="input">/pages/Logon.jsp</result>
|
||||
<result name="cancel" type="redirect-action">Welcome</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<result name="expired" type="chain">ChangePassword</result>
|
||||
<exception-mapping
|
||||
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
|
||||
result="expired"/>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Registration" class="mailreader2.Registration">
|
||||
<result name="input">/pages/Registration.jsp</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<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">
|
||||
<result name="input">/pages/Subscription.jsp</result>
|
||||
<result type="redirect-action">Registration!input</result>
|
||||
</action>
|
||||
|
||||
<action name="SubscriptionSave" class="mailreader2.SubscriptionSave">
|
||||
<result name="input">/pages/Subscription.jsp</result>
|
||||
<result type="redirect-action">Registration!input</result>
|
||||
<interceptor-ref name="user-submit" />
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
@@ -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>
|
||||
@@ -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')}"/>
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user