mirror of
https://github.com/apache/struts.git
synced 2026-08-06 07:06:58 +00:00
WW-1340 In MailReader, Update naming conventions to use "Login" rather than "Logon".
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@440443 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: LogonAction.java 360442 2005-12-31 20:10:04Z husted $
|
||||
* $Id: LoginAction.java 360442 2005-12-31 20:10:04Z husted $
|
||||
*
|
||||
* Copyright 2000-2004 Apache Software Foundation
|
||||
*
|
||||
@@ -22,9 +22,9 @@ import org.apache.struts.apps.mailreader.dao.User;
|
||||
import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException;
|
||||
|
||||
/**
|
||||
* <p> Validate a user logon. </p>
|
||||
* <p> Validate a user login. </p>
|
||||
*/
|
||||
public final class Logon extends MailreaderSupport {
|
||||
public final class Login extends MailreaderSupport {
|
||||
|
||||
public String execute() throws ExpiredPasswordException {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: LogonAction.java 360442 2005-12-31 20:10:04Z husted $
|
||||
* $Id: LoginAction.java 360442 2005-12-31 20:10:04Z husted $
|
||||
*
|
||||
* Copyright 2000-2004 Apache Software Foundation
|
||||
*
|
||||
@@ -21,7 +21,7 @@ package mailreader2;
|
||||
/**
|
||||
* <p> Log user out of the current session. </p>
|
||||
*/
|
||||
public class Logoff extends MailreaderSupport {
|
||||
public class Logout extends MailreaderSupport {
|
||||
|
||||
public String execute() {
|
||||
|
||||
@@ -9,9 +9,9 @@ import org.apache.struts.apps.mailreader.dao.User;
|
||||
public class Registration extends MailreaderSupport {
|
||||
|
||||
/**
|
||||
* <p>Double check that there is not a valid User logon. </p>
|
||||
* <p>Double check that there is not a valid User login. </p>
|
||||
*
|
||||
* @return True if there is not a valid User logon
|
||||
* @return True if there is not a valid User login
|
||||
*/
|
||||
private boolean isCreating() {
|
||||
User user = getUser();
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
password=Enter your Password here ==>
|
||||
struts.logo.path=/struts-power.gif
|
||||
struts.logo.path=struts-power.gif
|
||||
struts.logo.alt=Powered by Struts
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<global-results>
|
||||
<result name="error">/pages/Error.jsp</result>
|
||||
<result name="invalid.token">/pages/Error.jsp</result>
|
||||
<result name="login" type="redirect-action">Logon!input</result>
|
||||
<result name="login" type="redirect-action">Login!input</result>
|
||||
</global-results>
|
||||
|
||||
<global-exception-mappings>
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
<package name="mailreader-support" namespace="/" extends="mailreader-default">
|
||||
|
||||
<action name="Tour">
|
||||
<result>/pages/tour.html</result>
|
||||
<result>/tour.html</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Welcome" class="mailreader2.Welcome">
|
||||
<result>/pages/Welcome.jsp</result>
|
||||
<result>/Welcome.jsp</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Logoff" class="mailreader2.Logoff">
|
||||
<action name="Logout" class="mailreader2.Logout">
|
||||
<result type="redirect-action">Welcome</result>
|
||||
</action>
|
||||
|
||||
<action name="Logon!*" class="mailreader2.Logon" method="{1}">
|
||||
<result name="input">/pages/Logon.jsp</result>
|
||||
<action name="Login!*" class="mailreader2.Login" method="{1}">
|
||||
<result name="input">/Login.jsp</result>
|
||||
<result name="cancel" type="redirect-action">Welcome</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<result name="expired" type="chain">ChangePassword</result>
|
||||
@@ -32,25 +32,25 @@
|
||||
</action>
|
||||
|
||||
<action name="Registration!*" class="mailreader2.Registration" method="{1}">
|
||||
<result name="input">/pages/Registration.jsp</result>
|
||||
<result name="input">/Registration.jsp</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Subscription!save" class="mailreader2.SubscriptionSave">
|
||||
<result name="input">/pages/Subscription.jsp</result>
|
||||
<result name="input">/Subscription.jsp</result>
|
||||
<result type="redirect-action">Registration!input</result>
|
||||
<interceptor-ref name="user-submit" />
|
||||
</action>
|
||||
|
||||
<action name="Subscription!*" class="mailreader2.Subscription" method="{1}">
|
||||
<result name="input">/pages/Subscription.jsp</result>
|
||||
<result name="input">/Subscription.jsp</result>
|
||||
<result type="redirect-action">Registration!input</result>
|
||||
<interceptor-ref name="user" />
|
||||
</action>
|
||||
|
||||
<action name="*" class="mailreader2.MailreaderSupport">
|
||||
<result>/pages/{1}.jsp</result>
|
||||
<result>/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
@@ -9,7 +9,7 @@ change.message=Your password has expired. Please ask the system administrator t
|
||||
change.try=Try Again
|
||||
change.title=Password Has Expired
|
||||
database.load=Cannot load database from {0}
|
||||
error.database.missing=User database is missing, cannot validate logon credentials
|
||||
error.database.missing=User database is missing, cannot validate login credentials
|
||||
error.fromAddress.format=Invalid format for From Address
|
||||
error.fromAddress.required=From Address is required
|
||||
error.fullName.required=Full Name is required
|
||||
@@ -39,7 +39,7 @@ heading.user=User Name
|
||||
heading.type=Server Type
|
||||
heading.action=Action
|
||||
index.heading=MailReader Demonstration Application Options
|
||||
index.logon=Log on to the MailReader Demonstration Application
|
||||
index.login=Log on to the MailReader Demonstration Application
|
||||
index.registration=Register with the MailReader Demonstration Application
|
||||
index.title=MailReader Demonstration Application
|
||||
index.tour=A Walking Tour of the MailReader Demonstration Application
|
||||
@@ -47,9 +47,9 @@ linkSubscription.io=I/O Error: {0}
|
||||
linkSubscription.noSubscription=No subscription under attribute {0}
|
||||
linkUser.io=I/O Error: {0}
|
||||
linkUser.noUser=No user under attribute {0}
|
||||
logon.title=MailReader Demonstration Application - Logon
|
||||
login.title=MailReader Demonstration Application - Login
|
||||
mainMenu.heading=Main Menu Options for
|
||||
mainMenu.logoff=Log off MailReader Demonstration Application
|
||||
mainMenu.logout=Log off MailReader Demonstration Application
|
||||
mainMenu.registration=Edit your user registration profile
|
||||
mainMenu.title=MailReader Demonstration Application - Main Menu
|
||||
option.imap=IMAP Protocol
|
||||
|
||||
@@ -36,7 +36,7 @@ heading.user=\u30e6\u30fc\u30b6\u540d
|
||||
heading.type=\u30b5\u30fc\u30d0\u30bf\u30a4\u30d7
|
||||
heading.action=\u64cd\u4f5c
|
||||
index.heading=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 \u30aa\u30d7\u30b7\u30e7\u30f3
|
||||
index.logon=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30ed\u30b0\u30aa\u30f3
|
||||
index.login=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30ed\u30b0\u30aa\u30f3
|
||||
index.registration=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30e6\u30fc\u30b6\u767b\u9332
|
||||
index.title=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3(Struts 1.1-dev)
|
||||
index.tour=\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u6563\u7b56\u3059\u308b
|
||||
@@ -44,9 +44,9 @@ linkSubscription.io=I/O\u30a8\u30e9\u30fc: {0}
|
||||
linkSubscription.noSubscription=\u5c5e\u6027 {0} \u306b\u8cfc\u8aad\u60c5\u5831\u304c\u5b58\u5728\u3057\u307e\u305b\u3093
|
||||
linkUser.io=I/O\u30a8\u30e9\u30fc: {0}
|
||||
linkUser.noUser=\u5c5e\u6027 {0} \u306b\u30e6\u30fc\u30b6\u60c5\u5831\u304c\u5b58\u5728\u3057\u307e\u305b\u3093
|
||||
logon.title=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30ed\u30b0\u30aa\u30f3
|
||||
login.title=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30ed\u30b0\u30aa\u30f3
|
||||
mainMenu.heading=\u30e1\u30a4\u30f3\u30e1\u30cb\u30e5\u30fc
|
||||
mainMenu.logoff=MailReader \u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30ed\u30b0\u30aa\u30d5
|
||||
mainMenu.logout=MailReader \u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30ed\u30b0\u30aa\u30d5
|
||||
mainMenu.registration=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6
|
||||
mainMenu.title=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30e1\u30a4\u30f3\u30e1\u30cb\u30e5\u30fc
|
||||
option.imap=IMAP \u30d7\u30ed\u30c8\u30b3\u30eb
|
||||
|
||||
@@ -36,7 +36,7 @@ heading.user=\u0418\u043c\u044f
|
||||
heading.type=\u0422\u0438\u043f \u0441\u0435\u0440\u0432\u0435\u0440\u0430
|
||||
heading.action=\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435
|
||||
index.heading=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b'
|
||||
index.logon=\u0412\u043e\u0439\u0442\u0438 \u043a\u0430\u043a \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c
|
||||
index.login=\u0412\u043e\u0439\u0442\u0438 \u043a\u0430\u043a \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c
|
||||
index.registration=\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f
|
||||
index.title=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b' (Struts 1.1-dev)
|
||||
index.tour=\u041e\u0431\u0437\u043e\u0440 \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b'
|
||||
@@ -44,9 +44,9 @@ linkSubscription.io=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0432\u043e\u043
|
||||
linkSubscription.noSubscription=\u0410\u0442\u0440\u0438\u0431\u0443\u0442 {0} \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.
|
||||
linkUser.io=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0432\u043e\u0434\u0430/\u0432\u044b\u0432\u043e\u0434\u0430 (\u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f): {0}
|
||||
linkUser.noUser=\u0410\u0442\u0440\u0438\u0431\u0443\u0442 {0} \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.
|
||||
logon.title=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b - \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f.
|
||||
login.title=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b - \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f.
|
||||
mainMenu.heading=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u0434\u043b\u044f
|
||||
mainMenu.logoff=\u0412\u044b\u0439\u0442\u0438
|
||||
mainMenu.logout=\u0412\u044b\u0439\u0442\u0438
|
||||
mainMenu.registration=\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
|
||||
mainMenu.title=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b' - \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e
|
||||
option.imap=\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b IMAP
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="<s:url action="Logon!input"/>">
|
||||
<a href="<s:url action="Login!input"/>">
|
||||
<s:text name="change.try"/>
|
||||
</a>
|
||||
</p>
|
||||
+4
-4
@@ -4,15 +4,15 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><s:text name="logon.title"/></title>
|
||||
<title><s:text name="login.title"/></title>
|
||||
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
</head>
|
||||
|
||||
<body onLoad="self.focus();document.Logon.username.focus()">
|
||||
<body onLoad="self.focus();document.Login.username.focus()">
|
||||
|
||||
<s:actionerror />
|
||||
<s:form action="Logon" validate="true">
|
||||
<s:form action="Login" validate="true">
|
||||
<s:textfield label="%{getText('username')}" name="username"/>
|
||||
|
||||
<s:password label="%{getText('password')}" name="password" showPassword="true"/>
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<s:reset value="%{getText('button.reset')}"/>
|
||||
|
||||
<s:submit action="Logon!cancel" value="%{getText('button.cancel')}"
|
||||
<s:submit action="Login!cancel" value="%{getText('button.cancel')}"
|
||||
onclick="form.onsubmit=null"/>
|
||||
</s:form>
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
<s:text name="mainMenu.registration"/>
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="<s:url action="Logoff"/>">
|
||||
<s:text name="mainMenu.logoff"/>
|
||||
<li><a href="<s:url action="Logout"/>">
|
||||
<s:text name="mainMenu.logout"/>
|
||||
</a>
|
||||
</ul>
|
||||
</body>
|
||||
+2
-2
@@ -16,8 +16,8 @@
|
||||
<ul>
|
||||
<li><a href="<s:url action="Registration!input"/>"><s:text
|
||||
name="index.registration"/></a></li>
|
||||
<li><a href="<s:url action="Logon!input"/>"><s:text
|
||||
name="index.logon"/></a></li>
|
||||
<li><a href="<s:url action="Login!input"/>"><s:text
|
||||
name="index.login"/></a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Language Options</h3>
|
||||
+62
-62
@@ -62,18 +62,18 @@
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#Logon">Logon</a>
|
||||
<a href="#Login">Login</a>
|
||||
<ul>
|
||||
|
||||
<li><a href="#Logon.jsp">Logon Page</a></li>
|
||||
<li><a href="#Login.jsp">Login Page</a></li>
|
||||
|
||||
<li><a href="#Logon-validation.xml">Logon-validation.xml</a></li>
|
||||
<li><a href="#Login-validation.xml">Login-validation.xml</a></li>
|
||||
|
||||
<li><a href="#Logon.java">Logon.java</a></li>
|
||||
<li><a href="#Login.java">Login.java</a></li>
|
||||
|
||||
<li><a href="#MailreaderSupport.java">MailreaderSupport.java</a></li>
|
||||
|
||||
<li><a href="#Logon.xml">Logon Configuration</a></li>
|
||||
<li><a href="#Login.xml">Login Configuration</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -450,7 +450,7 @@ public class Welcome extends MailreaderSupport {
|
||||
<pre><code> <global-results>
|
||||
<result name=<strong>"error"</strong>><strong>/pages/Error.jsp</strong></result>
|
||||
<result name="invalid.token">/pages/Error.jsp</result>
|
||||
<result name="login" type="redirect-action">Logon!input</result>
|
||||
<result name="login" type="redirect-action">Login!input</result>
|
||||
</global-results></code></pre>
|
||||
<hr/>
|
||||
|
||||
@@ -534,7 +534,7 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
<h5>Message Resource entries used by the Welcome page</h5>
|
||||
<pre><code><strong>index.heading=</strong>MailReader Application Options
|
||||
<strong>index.logon=</strong>Log on to the MailReader Application
|
||||
<strong>index.login=</strong>Log on to the MailReader Application
|
||||
<strong>index.registration=</strong>Register with the MailReader Application
|
||||
<strong>index.title=</strong>MailReader Demonstration Application
|
||||
<strong>index.tour=</strong>A Walking Tour of the MailReader Demonstration Application</code></pre>
|
||||
@@ -574,8 +574,8 @@ public class Welcome extends MailreaderSupport {
|
||||
<ul>
|
||||
<li><a href="<s:url action="Registration!input"/>"><s:text
|
||||
name="index.registration"/></a></li>
|
||||
<li><a href="<s:url action="Logon!input"/>"><s:text
|
||||
name="index.logon"/></a></li>
|
||||
<li><a href="<s:url action="Login!input"/>"><s:text
|
||||
name="index.login"/></a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Language Options</h3>
|
||||
@@ -693,21 +693,21 @@ public class Welcome extends MailreaderSupport {
|
||||
When rendered, the Welcome page lists two menu options:
|
||||
one to register with the application and one to log on (if you have
|
||||
already registered).
|
||||
Let's follow the Logon link first.
|
||||
Let's follow the Login link first.
|
||||
</p>
|
||||
|
||||
<h3><a name="Logon" id="Logon">Logon</a></h3>
|
||||
<h3><a name="Login" id="Login">Login</a></h3>
|
||||
|
||||
<p>
|
||||
If you choose the Logon link, and all goes well, the Logon action forwards
|
||||
control to the Logon page.
|
||||
If you choose the Login link, and all goes well, the Login action forwards
|
||||
control to the Login page.
|
||||
</p>
|
||||
|
||||
<h4><a name="Logon.jsp" id="Logon.jsp">Logon Page</a></h4>
|
||||
<h4><a name="Login.jsp" id="Login.jsp">Login Page</a></h4>
|
||||
|
||||
<p>
|
||||
The Logon page displays a form that accepts a username and password.
|
||||
You can use the default username and password to logon
|
||||
The Login page displays a form that accepts a username and password.
|
||||
You can use the default username and password to login
|
||||
(<strong>user</strong> and <strong>pass</strong>), if
|
||||
you like. Try omitting or misspelling the username and password in
|
||||
various combinations to see how the application reacts.
|
||||
@@ -722,18 +722,18 @@ public class Welcome extends MailreaderSupport {
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><s:text name="logon.title"/></title>
|
||||
<title><s:text name="login.title"/></title>
|
||||
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
</head>
|
||||
<body onLoad="self.focus();document.Logon.username.focus()">
|
||||
<body onLoad="self.focus();document.Login.username.focus()">
|
||||
<strong><s:actionerror/></strong>
|
||||
<strong><s:form action="Logon" validate="true"></strong>
|
||||
<strong><s:form action="Login" validate="true"></strong>
|
||||
<strong><s:textfield label="%{getText('username')}" name="username"/></strong>
|
||||
<strong><s:password label="%{getText('password')}" name="password"/></strong>
|
||||
<strong><s:submit value="%{getText('button.save')}"/></strong>
|
||||
<strong><s:reset value="%{getText('button.reset')}"/></strong>
|
||||
<s:submit <strong>action="Logon!cancel" onclick="form.onsubmit=null"</strong>
|
||||
<s:submit <strong>action="Login!cancel" onclick="form.onsubmit=null"</strong>
|
||||
value="%{getText('button.cancel')}"/>
|
||||
</s:form>
|
||||
<jsp:include page="Footer.jsp"/>
|
||||
@@ -742,12 +742,12 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
We already saw some of the tags used by the Logon page on the Welcome page.
|
||||
We already saw some of the tags used by the Login page on the Welcome page.
|
||||
Let's focus on the new tags.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The first new tag on the Logon page is <strong>actionerrors</strong>.
|
||||
The first new tag on the Login page is <strong>actionerrors</strong>.
|
||||
Most of the possible validation errors are related to a single field.
|
||||
If you don't enter a username,
|
||||
the framework can place an error message near the tag prompting you to
|
||||
@@ -803,10 +803,10 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
<pre><code><tr>
|
||||
<td class="tdLabel">
|
||||
<label for="Logon_username" class="label">Username:</label>
|
||||
<label for="Login_username" class="label">Username:</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="username" value="" id="Logon_username"/>
|
||||
<input type="text" name="username" value="" id="Login_username"/>
|
||||
</td>
|
||||
</tr></code></pre>
|
||||
<hr/>
|
||||
@@ -875,14 +875,14 @@ public class Welcome extends MailreaderSupport {
|
||||
The second submit button is more interesting.
|
||||
</p>
|
||||
|
||||
<pre><code> <s:submit <strong>action="Logon!cancel" onclick="form.onsubmit=null"</strong>
|
||||
<pre><code> <s:submit <strong>action="Login!cancel" onclick="form.onsubmit=null"</strong>
|
||||
value="%{getText('button.cancel')}"/>
|
||||
</code></pre>
|
||||
|
||||
<p>
|
||||
Here we are creating the Cancel button for the form.
|
||||
The button's attribute <em>action="Logon<strong>!</strong>cancel"</em>
|
||||
tells the framework to submit to the Logon's "cancel" method
|
||||
The button's attribute <em>action="Login<strong>!</strong>cancel"</em>
|
||||
tells the framework to submit to the Login's "cancel" method
|
||||
instead of the usual "execute" method.
|
||||
The <em>onclick="form.onsubmit=null"</em> script defeats client-side validation.
|
||||
On the server side, "cancel" is on a special list of methods that bypass validation,
|
||||
@@ -911,7 +911,7 @@ public class Welcome extends MailreaderSupport {
|
||||
the "validation" file.
|
||||
</p>
|
||||
|
||||
<h4><a name="Logon-validation.xml" id="Logon-validation.xml">Logon-validation.xml</a>
|
||||
<h4><a name="Login-validation.xml" id="Login-validation.xml">Login-validation.xml</a>
|
||||
</h4>
|
||||
|
||||
<p>
|
||||
@@ -921,11 +921,11 @@ public class Welcome extends MailreaderSupport {
|
||||
|
||||
<p>
|
||||
The validation framework is configured through another XML document, the <strong>
|
||||
Logon-validation.xml</strong>.
|
||||
Login-validation.xml</strong>.
|
||||
</p>
|
||||
|
||||
<hr/>
|
||||
<h5>Validation file for Logon Action</h5>
|
||||
<h5>Validation file for Login Action</h5>
|
||||
<pre><code><!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
<validators>
|
||||
@@ -976,19 +976,19 @@ public class Welcome extends MailreaderSupport {
|
||||
</p>
|
||||
-->
|
||||
|
||||
<h4><a name="Logon.java" id="Logon.java">Logon Action</a></h4>
|
||||
<h4><a name="Login.java" id="Login.java">Login Action</a></h4>
|
||||
|
||||
<p>
|
||||
If validation passes, the framework invokes the "execute" method of the Logon Action.
|
||||
The actual Logon Action is brief, since most of the functionality derives
|
||||
If validation passes, the framework invokes the "execute" method of the Login Action.
|
||||
The actual Login Action is brief, since most of the functionality derives
|
||||
from the base class, <strong>MailreaderSupport</strong>.
|
||||
</p>
|
||||
|
||||
<hr/>
|
||||
<h5>Logon.java</h5>
|
||||
<h5>Login.java</h5>
|
||||
<pre><code>package mailreader2;
|
||||
import org.apache.struts.apps.mailreader.dao.User;
|
||||
public final class <strong>Logon</strong> extends MailreaderSupport {
|
||||
public final class <strong>Login</strong> extends MailreaderSupport {
|
||||
public String <strong>execute()</strong> throws ExpiredPasswordException {
|
||||
User user = <strong>findUser(getUsername(), getPassword());</strong>
|
||||
if (user != null) {
|
||||
@@ -1003,7 +1003,7 @@ public String <strong>execute()</strong> throws ExpiredPasswordException {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
Logon lays out what we do to authenticate a user.
|
||||
Login lays out what we do to authenticate a user.
|
||||
We try to find the user using the credentials provided.
|
||||
If the user is found, we cache a reference.
|
||||
If the user is not found, we return "input" so the client can try again.
|
||||
@@ -1099,7 +1099,7 @@ public void setPassword(String password) {
|
||||
|
||||
<p>
|
||||
When "findUser" returns,
|
||||
the Logon Action looks to see if a valid (non-null) User object is returned.
|
||||
the Login Action looks to see if a valid (non-null) User object is returned.
|
||||
A valid User is passed to the <strong>User property</strong>.
|
||||
Although it is still a JavaBean property,
|
||||
the User property is not implemented in quite the same way as Username and Password.
|
||||
@@ -1213,7 +1213,7 @@ public void <strong>setSession(Map value)</strong> {
|
||||
If a valid User is not found, or the password doesn't match,
|
||||
the "findUser" method invokes the <strong>addFieldError</strong> method to note the
|
||||
problem.
|
||||
When "findUser" returns, the Logon Action checks for errors,
|
||||
When "findUser" returns, the Login Action checks for errors,
|
||||
and then it returns either INPUT or SUCCESS.
|
||||
</p>
|
||||
|
||||
@@ -1241,29 +1241,29 @@ public void <strong>setSession(Map value)</strong> {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
But, what happens if Logon returns INPUT instead of SUCCESS.
|
||||
But, what happens if Login returns INPUT instead of SUCCESS.
|
||||
How does the framework know what to do next?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To answer that question,
|
||||
we need to turn back to the Struts configuration
|
||||
and look at how Logon is declared.
|
||||
and look at how Login is declared.
|
||||
</p>
|
||||
|
||||
|
||||
<h4><a name="Logon.xml" id="Logon.xml">Logon Configuration</a></h4>
|
||||
<h4><a name="Login.xml" id="Login.xml">Login Configuration</a></h4>
|
||||
|
||||
<p>
|
||||
The Logon action element outlines how the Logon workflow operates,
|
||||
The Login action element outlines how the Login workflow operates,
|
||||
including what to do when the Action returns "input",
|
||||
or the default result name "success".
|
||||
</p>
|
||||
|
||||
<hr/>
|
||||
<h5>mailreader-support.xml Logon</h5>
|
||||
<pre><code><action name="<strong>Logon!*</strong>" class="mailreader2.Logon" method="{1}">
|
||||
<result name="<strong>input</strong>">/pages/Logon.jsp</result>
|
||||
<h5>mailreader-support.xml Login</h5>
|
||||
<pre><code><action name="<strong>Login!*</strong>" class="mailreader2.Login" method="{1}">
|
||||
<result name="<strong>input</strong>">/pages/Login.jsp</result>
|
||||
<result name="<strong>cancel</strong>" type="redirect-action">Welcome</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<result name="<strong>expired</strong>" type="chain">ChangePassword</result>
|
||||
@@ -1275,14 +1275,14 @@ public void <strong>setSession(Map value)</strong> {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
You might notice that the name of the Logon action element is not "Logon"
|
||||
but "Logon<strong>!*</strong>".
|
||||
You might notice that the name of the Login action element is not "Login"
|
||||
but "Login<strong>!*</strong>".
|
||||
The asterisk is a special "wildcard" notation that tells the framework to match any series
|
||||
of character at this point.
|
||||
In the method attribute,
|
||||
the "{1}" notation indicates that framework should substitute whatever characters match
|
||||
the asterisk at runtime.
|
||||
When we cite actions like "Logon!cancel" or "Logon!input",
|
||||
When we cite actions like "Login!cancel" or "Login!input",
|
||||
the framework matches "cancel" or "input" with the wildcard and fills in the blanks.
|
||||
</p>
|
||||
|
||||
@@ -1304,19 +1304,19 @@ public void <strong>setSession(Map value)</strong> {
|
||||
Using wildcards with a exclamation point (or "bang") is not the only way we can use
|
||||
wilcards to invoke methods.
|
||||
If we wanted to use actions like "inputLogin",
|
||||
we could move the asterisk and use an action name like "*Logon".
|
||||
we could move the asterisk and use an action name like "*Login".
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Within the Logon action element, the first result element is named "input".
|
||||
Within the Login action element, the first result element is named "input".
|
||||
If validation or authentification fail,
|
||||
the Action class will return "input" and the framework will transfer control to the
|
||||
"Logon.jsp" page.
|
||||
"Login.jsp" page.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The second result element is named <strong>cancel</strong>.
|
||||
If someone presses the cancel button on the Logon page,
|
||||
If someone presses the cancel button on the Login page,
|
||||
the Action class will return "cancel", this result will be selected,
|
||||
and the framework will issue a redirect to the Welcome action.
|
||||
</p>
|
||||
@@ -1324,7 +1324,7 @@ public void <strong>setSession(Map value)</strong> {
|
||||
<p>
|
||||
The third result has no name,
|
||||
so it will be called if the default <strong>success</strong> token is returned.
|
||||
So, if the Logon succeeds,
|
||||
So, if the Login succeeds,
|
||||
control will transfer to the MainMenu action.
|
||||
</p>
|
||||
|
||||
@@ -1397,7 +1397,7 @@ public void <strong>setSession(Map value)</strong> {
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Finally, the Logon action specifies an <strong>InterceptorStack</strong>
|
||||
Finally, the Login action specifies an <strong>InterceptorStack</strong>
|
||||
named <strong>defaultStack.</strong>
|
||||
If you've worked with Struts 2 or WebWork 2 before, that might seem strange,
|
||||
since "defaultStack" is the factory default.
|
||||
@@ -1406,7 +1406,7 @@ public void <strong>setSession(Map value)</strong> {
|
||||
<p>
|
||||
In the MailReader application, most of the actions are only available
|
||||
to authenticated users.
|
||||
The exceptions are the Welcome, Logon, and Register actions
|
||||
The exceptions are the Welcome, Login, and Register actions
|
||||
which are available to everyone.
|
||||
To authenticate clients,
|
||||
the MailReader uses a custom Interceptor and a custom Interceptor stack.
|
||||
@@ -1444,7 +1444,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
If so, it returns normally, and the next Interceptor in the set would be invoked.
|
||||
If the User object is missing, the Interceptors returns "login".
|
||||
The framework would match "login" to the global result,
|
||||
and transfer control to the Logon action.
|
||||
and transfer control to the Login action.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -1519,7 +1519,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<p>
|
||||
Because the default interceptor stack will now authenticate the client,
|
||||
we need to specify the standard "defaultStack" for the three
|
||||
"guest actions", Welcome, Logon, and Register.
|
||||
"guest actions", Welcome, Login, and Register.
|
||||
Requiring authentification by default is the better practice, since it
|
||||
means that we won't forget to enable it when creating new actions.
|
||||
Meanwhile, those pesky users will ensure that we don't forget to disable
|
||||
@@ -1529,7 +1529,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<h3><a name="MainMenu" id="MainMenu">MainMenu</a></h3>
|
||||
|
||||
<p>
|
||||
On a successful logon, the Main Menu page displays.
|
||||
On a successful login, the Main Menu page displays.
|
||||
If you logged in using the demo account,
|
||||
the page title should be "Main Menu Options for John Q. User".
|
||||
Below this legend should be two links:
|
||||
@@ -1575,8 +1575,8 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<s:text name="mainMenu.registration"/>
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="<s:url <strong>action="Logoff"</strong> />">
|
||||
<s:text name="mainMenu.logoff"/>
|
||||
<li><a href="<s:url <strong>action="Logout"</strong> />">
|
||||
<s:text name="mainMenu.logout"/>
|
||||
</a>
|
||||
</ul>
|
||||
</body>
|
||||
@@ -1602,7 +1602,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<p>
|
||||
The customized MainMenu page offers two standard links.
|
||||
One is to "Edit your user registration profile".
|
||||
The other is to "Logoff the MailReader Demonstration Application".
|
||||
The other is to "Logout the MailReader Demonstration Application".
|
||||
</p>
|
||||
|
||||
<h3><a name="Registration.jsp" id="Registration.jsp">Registration page</a>
|
||||
@@ -2054,7 +2054,7 @@ public Subscription findSubscription(String host) {
|
||||
Likewise, the AuthentificationInterceptor will ensure that only clients
|
||||
with a valid User object can try to edit a Subscription.
|
||||
If the session expired, or someone bookmarked the page,
|
||||
the client will be redirected to the Logon page automatically.
|
||||
the client will be redirected to the Login page automatically.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Reference in New Issue
Block a user