Author: husted
Date: Fri Jan 6 03:31:18 2006
New Revision: 366479
URL: http://svn.apache.org/viewcvs?rev=366479&view=rev
Log:
MailReader Training Course
* Add example code for session 1-2
Added:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/
struts/sandbox/trunk/mailreader-course/lab-1-2-src/META-INF/
struts/sandbox/trunk/mailreader-course/lab-1-2-src/META-INF/context.xml
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/WEB-INF/
struts/sandbox/trunk/mailreader-course/lab-1-2-src/WEB-INF/web.xml (with
props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/MainMenu.jsp
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/RegisterForm.jsp
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-configure.xml
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-validate.xml
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/classes/
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/classes/MessageResources.properties
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/struts-config.xml
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/struts-html.tld
(with props)
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/web.xml
(with props)
Added: struts/sandbox/trunk/mailreader-course/lab-1-2-src/META-INF/context.xml
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/META-INF/context.xml?rev=366479&view=auto
==============================================================================
--- struts/sandbox/trunk/mailreader-course/lab-1-2-src/META-INF/context.xml
(added)
+++ struts/sandbox/trunk/mailreader-course/lab-1-2-src/META-INF/context.xml Fri
Jan 6 03:31:18 2006
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context path="/">
+</Context>
Propchange:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/META-INF/context.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/sandbox/trunk/mailreader-course/lab-1-2-src/WEB-INF/web.xml
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/WEB-INF/web.xml?rev=366479&view=auto
==============================================================================
--- struts/sandbox/trunk/mailreader-course/lab-1-2-src/WEB-INF/web.xml (added)
+++ struts/sandbox/trunk/mailreader-course/lab-1-2-src/WEB-INF/web.xml Fri Jan
6 03:31:18 2006
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>
\ No newline at end of file
Propchange: struts/sandbox/trunk/mailreader-course/lab-1-2-src/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/MainMenu.jsp
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/MainMenu.jsp?rev=366479&view=auto
==============================================================================
--- struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/MainMenu.jsp
(added)
+++ struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/MainMenu.jsp Fri
Jan 6 03:31:18 2006
@@ -0,0 +1,16 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+<html>
+<head>
+ <title>Main Menu</title>
+</head>
+
+<body>
+<h3>Main Menu Options for <bean:write name="RegisterForm"
+ property="fullName"/></h3>
+<ul>
+ <li>[TODO] Edit Profile</li>
+ <li>[TODO] Logout</li>
+</ul>
+</body>
+</html>
Propchange:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/MainMenu.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/RegisterForm.jsp
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/RegisterForm.jsp?rev=366479&view=auto
==============================================================================
--- struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/RegisterForm.jsp
(added)
+++ struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/RegisterForm.jsp
Fri Jan 6 03:31:18 2006
@@ -0,0 +1,89 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
+
+<html:html>
+ <head>
+ <title>Register Form</title>
+ </head>
+
+ <body>
+
+ <html:errors/>
+
+ <html:form action="/RegisterSave">
+ <table border="0" width="100%">
+
+ <tr>
+ <th align="right">
+ Username:
+ </th>
+ <td align="left">
+ <html:text property="username" size="16" maxlength="16"/>
+ </td>
+ </tr>
+
+ <tr>
+ <th align="right">
+ Password:
+ </th>
+ <td align="left">
+ <html:password property="password" size="16"
+ maxlength="16"/>
+ </td>
+ </tr>
+
+ <tr>
+ <th align="right">
+ Confirm Password:
+ </th>
+ <td align="left">
+ <html:password property="password2" size="16"
+ maxlength="16"/>
+ </td>
+ </tr>
+
+ <!-- Lab 1-2: Insert remaining fields from use case -->
+
+ <tr>
+ <th align="right">
+ Fullname:
+ </th>
+ <td align="left">
+ <html:text property="fullName" size="50"/>
+ </td>
+ </tr>
+
+ <tr>
+ <th align="right">
+ From Address:
+ </th>
+ <td align="left">
+ <html:text property="fromAddress" size="50"/>
+ </td>
+ </tr>
+
+ <tr>
+ <th align="right">
+ Reply To Address:
+ </th>
+ <td align="left">
+ <html:text property="replyToAddress" size="50"/>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <html:submit value="SAVE"/>
+ </td>
+ <td align="left">
+ <html:reset value="RESET"/>
+
+ <html:cancel value="CANCEL"/>
+ </td>
+ </tr>
+
+ </table>
+ </html:form>
+
+ </body>
+</html:html>
Propchange:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/RegisterForm.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-configure.xml
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-configure.xml?rev=366479&view=auto
==============================================================================
---
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-configure.xml
(added)
+++
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-configure.xml
Fri Jan 6 03:31:18 2006
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE struts-config PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
+ "http://struts.apache.org/dtds/struts-config_1_3.dtd">
+
+<struts-config>
+
+ <form-beans>
+ <form-bean
+ name="RegisterForm"
+ type="org.apache.struts.validator.DynaValidatorForm">
+ <form-property
+ name="username"
+ type="java.lang.String"/>
+ <form-property
+ name="password"
+ type="java.lang.String"/>
+ <form-property
+ name="password2"
+ type="java.lang.String"/>
+ <!-- Lab 1-2: Insert remaining fields from use case -->
+ <form-property
+ name="fullName"
+ type="java.lang.String"/>
+ <form-property
+ name="fromAddress"
+ type="java.lang.String"/>
+ <form-property
+ name="replyToAddress"
+ type="java.lang.String"/>
+ </form-bean>
+ </form-beans>
+
+ <action-mappings
+ type="org.apache.struts.action.RequestActionMapping">
+
+ <action path="/Register"
+ name="RegisterForm"
+ forward="/RegisterForm.jsp"
+ validate="false"/>
+
+ <action path="/RegisterSave"
+ name="RegisterForm"
+ validate="true"
+ input="/Register.do"
+ forward="/MainMenu.jsp"/>
+
+ </action-mappings>
+
+</struts-config>
Propchange:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-configure.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-validate.xml
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-validate.xml?rev=366479&view=auto
==============================================================================
---
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-validate.xml
(added)
+++
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-validate.xml
Fri Jan 6 03:31:18 2006
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE form-validation PUBLIC
+ "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.2.0//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
+
+<form-validation>
+
+ <formset>
+ <form name="RegisterForm">
+
+ <field property="username" depends="required">
+ <arg position="0" key="username.label"/>
+ </field>
+
+ <field property="password" depends="required">
+ <arg position="0" key="password.label"/>
+ </field>
+
+ <field property="password2" depends="required,validwhen">
+ <arg position="0" key="password2.label"/>
+ <var>
+ <var-name>test</var-name>
+ <var-value>(*this* == password)</var-value>
+ </var>
+ </field>
+
+ <!-- Lab 1-2: Insert remaining fields from use case -->
+
+ <field property="fullName"
+ depends="required">
+ <arg key="fullName.label"/>
+ </field>
+
+ <field property="fromAddress"
+ depends="required,email">
+ <arg key="fromAddress.label"/>
+ </field>
+
+ <field property="replyToAddress"
+ depends="email">
+ <arg key="replyToAddress.label"/>
+ </field>
+
+ </form>
+ </formset>
+</form-validation>
Propchange:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/Register-validate.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/classes/MessageResources.properties
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/classes/MessageResources.properties?rev=366479&view=auto
==============================================================================
---
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/classes/MessageResources.properties
(added)
+++
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/classes/MessageResources.properties
Fri Jan 6 03:31:18 2006
@@ -0,0 +1,14 @@
+errors.footer=</ul><hr>
+errors.header=<h3><font color="red">Validation Error</font></h3><p>You must
correct the following error(s) before proceeding:</p><ul>
+errors.prefix=<li>
+errors.suffix=</li>
+errors.ioException=I/O exception rendering error messages: {0}
+errors.required={0} is required.
+errors.email={0} is not a valid email address.
+username.label=Username
+password.label=Password
+password2.label=Confirm Password
+# Lab 1-2: Insert remaining fields from use case
+fullName.label=Full Name
+fromAddress.label=From Address
+replyToAddress.label=Reply To Address
Propchange:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/classes/MessageResources.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/struts-config.xml
URL:
http://svn.apache.org/viewcvs/struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/struts-config.xml?rev=366479&view=auto
==============================================================================
---
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/struts-config.xml
(added)
+++
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/struts-config.xml
Fri Jan 6 03:31:18 2006
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE struts-config PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
+ "http://struts.apache.org/dtds/struts-config_1_3.dtd">
+
+<struts-config>
+
+ <message-resources
+ parameter="MessageResources"/>
+
+ <plug-in
+ className="org.apache.struts.validator.ValidatorPlugIn">
+ <set-property
+ property="pathnames"
+ value="/org/apache/struts/validator/validator-rules.xml,
+ /WEB-INF/Register-validate.xml"
+ />
+ </plug-in>
+
+</struts-config>
Propchange:
struts/sandbox/trunk/mailreader-course/lab-1-2-src/webapp/WEB-INF/struts-config.xml
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]