You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/12/09 03:04:39 UTC

svn commit: r355312 - /struts/apps/trunk/mailreader/src/webapp/tour.html

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 @@
 
 &lt;html&gt;
 &lt;head&gt;
-&lt;title&gt;&lt;bean:message key="index.title"/&gt;&lt;/title&gt;
+&lt;title&gt;&lt;<strong>bean:message</strong> key="index.title"/&gt;&lt;/title&gt;
 &lt;link rel="stylesheet" type="text/css" href="base.css" /&gt;
 &lt;/head&gt;
 
 &lt;h3&gt;&lt;bean:message key="index.heading"/&gt;&lt;/h3&gt;
 &lt;ul&gt;
-&lt;li&gt;&lt;html:link action="/EditRegistration"&gt;
+&lt;li&gt;&lt;<strong>html:link</strong> action="/EditRegistration"&gt;
 &lt;bean:message key="index.registration"/&gt;&lt;/html:link&gt;&lt;/li&gt;
 &lt;li&gt;&lt;html:link action="/Logon"&gt;&lt;bean:message key="index.logon"/&gt;&lt;/html:link&gt;&lt;/li&gt;
 &lt;/ul&gt;
@@ -425,7 +432,7 @@
 
 &lt;hr /&gt;
 
-&lt;p&gt;&lt;html:img bundle="alternate" pageKey="struts.logo.path" altKey="struts.logo.alt"/&gt;&lt;/p&gt;
+&lt;p&gt;&lt;<strong>html:img</strong> bundle="alternate" pageKey="struts.logo.path" altKey="struts.logo.alt"/&gt;&lt;/p&gt;
 
 &lt;p&gt;&lt;html:link action="/Tour"&gt;&lt;bean:message key="index.tour"/&gt;&lt;/html:link&gt;&lt;/p&gt;
 
@@ -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 @@
 &lt;title&gt;&lt;bean:message key="logon.title"/&gt;&lt;/title&gt;
 &lt;/head&gt;
 
-&lt;html:errors/&gt;
+&lt;<strong>html:errors</strong>/&gt;
 
-&lt;html:form action="/SubmitLogon" focus="username"
+&lt;<strong>html:form</strong> action="/SubmitLogon" focus="username"
          onsubmit="return validateLogonForm(this);"&gt;
 &lt;table border="0" width="100%"&gt;
 
@@ -530,7 +541,7 @@
       &lt;bean:message key="prompt.username"/&gt;:
     &lt;/th&gt;
     &lt;td align="left"&gt;
-      &lt;html:text property="username" size="16" maxlength="18"/&gt;
+      &lt;<strong>html:text</strong> property="username" size="16" maxlength="18"/&gt;
     &lt;/td&gt;
   &lt;/tr&gt;
 
@@ -539,17 +550,17 @@
       &lt;bean:message key="prompt.password" bundle="alternate"/&gt;:
     &lt;/th&gt;
     &lt;td align="left"&gt;
-      &lt;html:password property="password" size="16" maxlength="18"
+      &lt;<strong>html:password</strong> property="password" size="16" maxlength="18"
                     redisplay="false"/&gt;
     &lt;/td&gt;
   &lt;/tr&gt;
 
   &lt;tr&gt;
     &lt;td align="right"&gt;
-      &lt;html:submit property="Submit" value="Submit"/&gt;
+      &lt;<strong>html:submit</strong> property="Submit" value="Submit"/&gt;
     &lt;/td&gt;
     &lt;td align="left"&gt;
-      &lt;html:reset/&gt;
+      &lt;<strong>html:reset</strong>/&gt;
     &lt;/td&gt;
   &lt;/tr&gt;
 
@@ -557,7 +568,7 @@
 
 &lt;/html:form&gt;
 
-&lt;html:javascript formName="LogonForm"
+&lt;<strong>html:javascript</strong> formName="LogonForm"
         dynamicJavascript="true"
          staticJavascript="false"/&gt;
 &lt;script language="Javascript1.1" src="StaticJavascript.jsp"&gt;&lt;/script&gt;
@@ -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 @@
         &lt;action
                 path="/SubmitLogon"
                 type="org.apache.struts.apps.mailreader.actions.LogonAction"
-                name="LogonForm"
-                scope="request"
-                validate="request"
-                input="Logon">
-            &lt;exception
+                <strong>name</strong>="LogonForm"
+                <strong>scope</strong>="request"
+                <strong>validate</strong>="request"
+                <strong>input</strong>="Logon">
+            &lt;<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 @@
         &lt;/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">
 
             &lt;field
-                    property="username"
+                    property="<strong>username</strong>"
                     depends="required">
                 &lt;arg
                         key="prompt.username"/>
             &lt;/field>
 
             &lt;field
-                    property="password"
+                    property="<strong>password</strong>"
                     depends="required, minlength,maxlength">
                 &lt;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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org