Author: husted
Date: Thu Dec 8 18:04:36 2005
New Revision: 355312
URL: http://svn.apache.org/viewcvs?rev=355312&view=rev
Log:
MailReader tour
* Tweak some of the formatting north of MainMenu.
Modified:
struts/apps/trunk/mailreader/src/webapp/tour.html
Modified: struts/apps/trunk/mailreader/src/webapp/tour.html
URL:
http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/webapp/tour.html?rev=355312&r1=355311&r2=355312&view=diff
==============================================================================
--- struts/apps/trunk/mailreader/src/webapp/tour.html (original)
+++ struts/apps/trunk/mailreader/src/webapp/tour.html Thu Dec 8 18:04:36 2005
@@ -128,14 +128,18 @@
Struts University MailReader site</a>.
</p>
+ <hr />
<blockquote>
- <p>
+ <p><font class="hint">
+ <strong>JAAS</strong> -
Note that for compatability and ease of deployment, the MailReader
uses "application-based" authorization.
However, use of the standard Java Authentication and Authorization
Service (JAAS) is recommended for most
applications.
(See the <a
href="http://struts.apache.org/struts-action/userGuide/preface.html">
- Preface to the Struts Action User Guide</a> for more about
authentification technologies.)</p>
+ Preface to the Struts Action User Guide</a> for more about
authentification technologies.)
+ </font></p>
</blockquote>
+ <hr />
<p>
The walkthrough starts with how the initial welcome page is displayed,
and then steps through logging in,
@@ -231,7 +235,7 @@
<hr />
<p>
- Here, the "WelcomeAction" Java class executes whenever someone asks
for the Welcome action.
+ Here, the <strong>WelcomeAction</strong> Java class executes whenever
someone asks for the Welcome action.
As it completes, the Action class can select which "result" is
displayed.
One available result is "success".
Another available result, defined at a global scope, is "failure".
@@ -289,9 +293,9 @@
One section of the Struts configuration is devoted to "PlugIns".
When a Struts application loads, it also loads whatever PlugIns are
specified in its configuration.
The PlugIn interface is quite simple.
-
</p>
+ <hr />
<h5>org.apache.struts.action.PlugIn</h5>
<pre><code>public interface PlugIn {
@@ -382,7 +386,6 @@
<p>
The MailReader application uses a second set of message resources for
non-text elements.
- The "key" element can be used to access this resource bundle rather
than the default bundle.
</p>
<hr />
@@ -392,6 +395,10 @@
key="alternate"/></code></pre>
<hr />
+ <p>
+ The "key" element can be used to access this resource bundle rather
than the default bundle.
+ </p>
+
<h3><a name="welcome.jsp" id="welcome.jsp">Welcome page</a></h3>
<p>
@@ -405,13 +412,13 @@
<html>
<head>
-<title><bean:message key="index.title"/></title>
+<title><<strong>bean:message</strong>
key="index.title"/></title>
<link rel="stylesheet" type="text/css" href="base.css" />
</head>
<h3><bean:message key="index.heading"/></h3>
<ul>
-<li><html:link action="/EditRegistration">
+<li><<strong>html:link</strong> action="/EditRegistration">
<bean:message key="index.registration"/></html:link></li>
<li><html:link action="/Logon"><bean:message
key="index.logon"/></html:link></li>
</ul>
@@ -425,7 +432,7 @@
<hr />
-<p><html:img bundle="alternate" pageKey="struts.logo.path"
altKey="struts.logo.alt"/></p>
+<p><<strong>html:img</strong> bundle="alternate"
pageKey="struts.logo.path" altKey="struts.logo.alt"/></p>
<p><html:link action="/Tour"><bean:message
key="index.tour"/></html:link></p>
@@ -440,14 +447,14 @@
</p>
<p>
- The bean:message tag inserts a message from the MessageResources file
we mentioned in the last section.
+ The <strong>bean:message</strong> tag inserts a message from the
MessageResources file we mentioned in the last section.
The MailReader comes with support for three locales: English (the
default), Russian, and Japanese.
If the Struts Action locale setting is changed for a user,
the bean:message tag will render messages from that locale's property
bundle instead.
</p>
<p>
- The html:link tag does double duty.
+ The <strong>html:link</strong> tag does double duty.
First, you can refer to an action or forward stored in the Struts
configuration,
and the tag will insert the corresponding path when the page is
rendered.
This makes it easy to "rewire" an application without touching all the
pages.
@@ -456,17 +463,21 @@
</p>
<hr/>
- <h5>Technical Stuff:</h5>
+ <h5>Note:</h5>
<blockquote>
- <p><font class="hint">If you turn cookies off in your browser, and then
reload your browser and this page,
+ <p><font class="hint">
+ <strong>Cookies</strong> -
+ If you turn cookies off in your browser, and then reload your
browser and this page,
you will see the links with the Java session id information attached.
- (If you are using Internet Explorer and try this, be sure you reset
cookies for the appropriate security zone,
- and that you disallow "per-session" cookies.)</font></p>
+ (If you are using Internet Explorer and try this,
+ be sure you reset cookies for the appropriate security zone,
+ and that you disallow "per-session" cookies.)
+ </font></p>
</blockquote>
<hr/>
<p>
- The html:img tag renders an img tag.
+ The <strong>html:img</strong> tag renders an img tag.
When necessary, the src URI is encoded as it is with the link tag.
In this case, the tag inserts the src path from the "alternate"
MessageResource bundle,
along with the text for the alt element.
@@ -519,9 +530,9 @@
<title><bean:message key="logon.title"/></title>
</head>
-<html:errors/>
+<<strong>html:errors</strong>/>
-<html:form action="/SubmitLogon" focus="username"
+<<strong>html:form</strong> action="/SubmitLogon" focus="username"
onsubmit="return validateLogonForm(this);">
<table border="0" width="100%">
@@ -530,7 +541,7 @@
<bean:message key="prompt.username"/>:
</th>
<td align="left">
- <html:text property="username" size="16" maxlength="18"/>
+ <<strong>html:text</strong> property="username" size="16"
maxlength="18"/>
</td>
</tr>
@@ -539,17 +550,17 @@
<bean:message key="prompt.password" bundle="alternate"/>:
</th>
<td align="left">
- <html:password property="password" size="16" maxlength="18"
+ <<strong>html:password</strong> property="password" size="16"
maxlength="18"
redisplay="false"/>
</td>
</tr>
<tr>
<td align="right">
- <html:submit property="Submit" value="Submit"/>
+ <<strong>html:submit</strong> property="Submit" value="Submit"/>
</td>
<td align="left">
- <html:reset/>
+ <<strong>html:reset</strong>/>
</td>
</tr>
@@ -557,7 +568,7 @@
</html:form>
-<html:javascript formName="LogonForm"
+<<strong>html:javascript</strong> formName="LogonForm"
dynamicJavascript="true"
staticJavascript="false"/>
<script language="Javascript1.1"
src="StaticJavascript.jsp"></script>
@@ -573,7 +584,7 @@
</p>
<p>
- The first new tag on the logon page is "html:errors".
+ The first new tag on the logon page is <strong>html:errors</strong>.
The credentials you entered are validated and processed by a
"LogonAction" class.
If the credentials are incorrect,
the LogonAction posts an appropriate error message and forwards back
to the input page.
@@ -583,7 +594,7 @@
</p>
<p>
- The second new tag is "html:form".
+ The second new tag is <strong>html:form</strong>.
This tag renders a html form tag.
The "action" element tells the tag to use "SubmitLogon.do" for the
form's action.
The "focus" attribute tells the tag to generate a little Javascript
after the form that
@@ -594,22 +605,22 @@
<p>
Within the html:form tag,
- we see four other new tags: "html:text", "html:password",
"html:submit", and "html:reset".
+ we see five more new tags: "html:text", "html:password",
"html:submit", "html:reset", and "html:javascript".
</p>
<p>
- The html:text tag renders a "input type=text" tag.
+ The <strong>html:text</strong> tag renders a "input type=text" tag.
The "property" attribute becomes the input tag's "name" attribute.
</p>
<p>
- The html:password tag renders a "input type=password" tag.
+ The <strong>html:password</strong> tag renders a "input type=password"
tag.
The "redisplay" attribute tell the tag not to render the password back
into the file, if the submit fails.
- The html:submit and html:reset tags render buttons of the
corresponding types.
+ The <strong>html:submit</strong> and <strong>html:reset</strong> tags
render buttons of the corresponding types.
</p>
<p>
- Following the form is a "html:javascript" tag.
+ Following the form is a <strong>html:javascript</strong> tag.
This tag works with the Struts Validator component to generate a
JavaScript that can validate input
before it is submitted to the LogonAction.
</p>
@@ -648,11 +659,11 @@
<action
path="/SubmitLogon"
type="org.apache.struts.apps.mailreader.actions.LogonAction"
- name="LogonForm"
- scope="request"
- validate="request"
- input="Logon">
- <exception
+ <strong>name</strong>="LogonForm"
+ <strong>scope</strong>="request"
+ <strong>validate</strong>="request"
+ <strong>input</strong>="Logon">
+ <<strong>exception</strong>
key="expired.password"
type="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
path="/ChangePassword.jsp"/>
@@ -670,7 +681,7 @@
<h4>The "name" attribute</h4>
<p>
- The "name" attribute specifies something Struts Action calls an
"ActionForm".
+ The <strong>name</strong> attribute specifies something Struts Action
calls an "ActionForm".
The ActionForm buffers input from a form and delivers it to an Action
class as an object.
The ActionForm can also validate the input.
If validation fails, the tags can rewrite the input values from the
ActionForm.
@@ -691,7 +702,7 @@
<p>
Hmmmm. That doesn't seem to tell us much.
The LogonForm "extends" the BaseForm, but doesn't add any properties.
- Here's the BaseForm element that LogonForm extends:
+ What about the BaseForm element that LogonForm extends?
</p>
<hr />
@@ -713,10 +724,10 @@
</form-bean></code></pre>
<hr />
- <h5>Technical Stuff:</h5>
+ <h5>Note:</h5>
<blockquote>
<p><font class="hint">
- Extends - In the Struts configuration file,
+ <strong>Extends</strong> - In the Struts configuration file,
we can use the "extends" attribute to adopt default settings from
another element.
Extends makes using XML elements much more like object-orientated
programming.
You can setup a base element, and then only specify the behavior
that changes.
@@ -741,7 +752,7 @@
<h4>The "scope" attribute</h4>
<p>
- The "scope" attribute in the "SubmitLogon" action element
+ The <strong>scope</strong> attribute in the "SubmitLogon" action
element
tells the controller whether to store the ActionForm in the request,
rather than in the user's session.
</p>
@@ -758,7 +769,8 @@
<h4>The "validate" attribute</h4>
<p>
- Struts can validate the ActionForm automatically.
+ The <strong>validate</strong> attribute controls whether the framework
will automatically validate
+ the ActionForm.
Conventional ActionForms have a stub "validate" method that you can
implement.
MailReader uses the Validator framework instead,
so the validations are specified in another configuration file.
@@ -767,14 +779,14 @@
<h4>The "input" attribute</h4>
<p>
- If validation fails, Struts looks for the forward specified by the
"input" attribute.
+ If validation fails, Struts looks for the forward specified by the
<strong>input</strong> attribute.
In this case, invoking the global "Logon" forward sends control back
to the Logon.jsp page.
</p>
<h4>The "exception" element</h4>
<p>
- Within the SubmitLogon action element is another new element,
"exception".
+ Within the SubmitLogon action element is another new element,
<strong>exception</strong>.
When a user logons on, it's possible that an
"ExpiredPasswordException" will be thrown.
Should this happen, Struts will capture the exception and send control
to the "ChangePassword" action.
</p>
@@ -783,7 +795,7 @@
<p>
In the Logon page, we mentioned that the html:javascript tag confers
with the Struts Validator components.
- The Validator is configured through another XML document, the
"validation.xml".
+ The Validator is configured through another XML document, the
<strong>validation.xml</strong>.
</p>
<hr />
@@ -792,14 +804,14 @@
name="LogonForm">
<field
- property="username"
+ property="<strong>username</strong>"
depends="required">
<arg
key="prompt.username"/>
</field>
<field
- property="password"
+ property="<strong>password</strong>"
depends="required, minlength,maxlength">
<arg
key="prompt.password"/>
@@ -835,12 +847,12 @@
<p>
The field elements correspond to the ActionForm properties.
- The "username" field element says it depends on the "required"
validator.
+ The <strong>username</strong> field element says it depends on the
"required" validator.
If the username is blank or absent, validation will fail and an error
message is automatically generated.
</p>
<p>
- The "password" field (or property) is also required.
+ The <strong>password</strong> field (or property) is also required.
In addition, it must also pass the "maxlength" and "minlength"
validations.
Here, the minimum length is three characters and the maximum length is
sixteen.
If the length of the password doesn't meet these criteria, a
corresponding error message is generated.
@@ -869,10 +881,10 @@
// Retrieve user
UserDatabase database = doGetUserDatabase();
- String username = doGet(form, USERNAME);
+ String username = <strong>doGet</strong>(form, USERNAME);
String password = doGet(form, PASSWORD);
ActionMessages errors = new ActionMessages();
- User user = doGetUser(database,username,password,errors);
+ User user =
<strong>doGetUser</strong>(database,username,password,errors);
// Report back any errors, and exit if any
if (!errors.isEmpty()) {
@@ -881,7 +893,7 @@
}
// Cache user object in session to signify logon
- doCacheUser(request,user);
+ <strong>>doCacheUser</strong>(request,user);
// Done
return doFindSuccess(mapping);
@@ -892,7 +904,7 @@
<p>
LogonAction extends another Action class, BaseAction.
BaseAction provides a number of helper methods, all of which are
prefixed with "do".
- The "doCacheUser" method, for example, stores the user object in the
session,
+ The <strong>>doCacheUser</strong> method, for example, stores the user
object in the session,
and logs the event, if the logging level is set to debug.
</p>
@@ -917,7 +929,7 @@
Because our ActionForm is a DynaActionForm,
we can't access or change the properties directly using methods like
"getUsername".
To make working with DynaActionForm properties easier,
- BaseAction provides two simple helper methods, doGet and doSet.
+ BaseAction provides two simple helper methods, <strong>doGet</strong>
and <strong>doSet</strong>.
</p>
<hr />
@@ -937,7 +949,7 @@
return value;
}
- protected boolean doSet(ActionForm form, String property, String value) {
+ protected boolean <strong>doSet</strong>(ActionForm form, String property,
String value) {
try {
DynaActionForm dyna = (DynaActionForm) form;
dyna.set(property,value);
@@ -949,7 +961,7 @@
<hr />
<p>
- LogonAction uses on other BaseAction helper: "doGetUser",
+ LogonAction uses one other BaseAction helper:
<strong>doGetUser</strong>,
which does the real work of the method.
The "doGetUser" method checks the tendered credentials against the
database,
If there are any issues, like there is not a user by that name, or the
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]