[cvs] expresso commit by rimovm: Updated Documentation/Changelog Update of

JCorporate Ltd jcorp at jcorporate.com
Fri May 6 21:30:35 UTC 2005


Log Message:
-----------
Updated Documentation/Changelog
Update of Registration Controller and Login Controller to new API.

Modified Files:
--------------
    expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller:
        ControllerRequest.java
    expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj:
        RequestContext.java
    expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller:
        LoginController.java
        Registration.java
        SimpleLoginController.java
    expresso/expresso-web/WEB-INF/test-src/com/jcorporate/expresso/core/controller/tests:
        DeprecatedTestController.java
    expresso/expresso-web/expresso/doc:
        ChangeLog.xml
    expresso/expresso-web/expresso/doc/edg:
        controllers.xml

Revision Data
-------------
Index: ChangeLog.xml
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/expresso/doc/ChangeLog.xml,v
retrieving revision 1.307
retrieving revision 1.308
diff -Lexpresso-web/expresso/doc/ChangeLog.xml -Lexpresso-web/expresso/doc/ChangeLog.xml -u -r1.307 -r1.308
--- expresso-web/expresso/doc/ChangeLog.xml
+++ expresso-web/expresso/doc/ChangeLog.xml
@@ -224,6 +224,14 @@
 				<explanation>Final switch over to ORO as default package.</explanation>
 				<contributor>Michael Rimov</contributor>
 			</api-change>
+			<api-change title="Controller Element Map-based capabilities">
+				<explanation>ControllerElement access has Map-based and List-based accessor methods now.</explanation>
+				<contributor>Michael Rimov</contributor>
+			</api-change>
+			<api-change title="ExpressoRequest/ExpressoResponse Interfaces">
+				<explanation>Expresso can now use state handlers based off of new Interfaces called ExpressoRequest/ExpressoResponse.  Most of the methods found in ControllerRequest/Response still exist, but by using the interfaces, you gain the ability to create proxy objects for unit testing.</explanation>
+				<contributor>Michael Rimov</contributor>
+			</api-change>
 			<bug-fix title="MultiDBObject handles otherDB map">
 				<explanation>MultiDBObject handles otherDB map by adding schema (db) name
                 in front of table name in SQL queries, as necessary.</explanation>
Index: ControllerRequest.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ControllerRequest.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ControllerRequest.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ControllerRequest.java -u -r1.38 -r1.39
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ControllerRequest.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/core/controller/ControllerRequest.java
@@ -423,6 +423,9 @@
      * and we decide if they're allowed to access the given state.
      *
      * @param newUser The user's string id to set this user to.
+     * @deprecated Do not use any more.  Create a new MutableRequestRegistry()
+     * or use the superUser() capabilities of the RequestRegistry to change
+     * the user security credentials.
      */
     public void setUser(String newUser) {
         userName = newUser;
@@ -492,13 +495,15 @@
      * Get the user name
      *
      * @return the currently logged in user or NONE if there's no user logged in
+     * @deprecated Since Expresso 5.7Do not use any longer.  Use RequestRegistry.getUser() instead.
      */
     public String getUser() {
-        if (userName == null) {
-            return User.UNKNOWN_USER;
+        try {
+            return RequestRegistry.getUser().getLoginName();
+        } catch (DBException ex) {
+            log.error("Error getting login name from registry", ex);
+            throw new RuntimeException("Error getting login name from registry.");
         }
-
-        return userName;
     }
     /* getUser() */
 
@@ -506,9 +511,15 @@
      * Get the user id as an integer
      *
      * @return an integer representing the internal UID
+     * @deprecated Since Expresso 5.7 Use RequestRegistry.getUser().getUid() instead.
      */
     public int getUid() {
-        return uid;
+        try {
+            return RequestRegistry.getUser().getUid();
+        } catch (DBException ex) {
+            log.error("Error getting login name from registry", ex);
+            throw new RuntimeException("Error getting login name from registry.");
+        }
     }
 
     /**
Index: RequestContext.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/RequestContext.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/RequestContext.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/RequestContext.java -u -r1.7 -r1.8
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/RequestContext.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/RequestContext.java
@@ -73,6 +73,7 @@
  * from a DBOBject.
  *
  * @author Michael Rimov
+ * @deprecated Since Expresso 5.7 Use RequestRegistry instead.
  */
 public interface RequestContext {
     /**
Index: LoginController.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/LoginController.java,v
retrieving revision 1.65
retrieving revision 1.66
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/LoginController.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/LoginController.java -u -r1.65 -r1.66
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/LoginController.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/LoginController.java
@@ -69,8 +69,8 @@
 
 import com.jcorporate.expresso.core.controller.Controller;
 import com.jcorporate.expresso.core.controller.ControllerException;
-import com.jcorporate.expresso.core.controller.ControllerRequest;
-import com.jcorporate.expresso.core.controller.ControllerResponse;
+import com.jcorporate.expresso.core.controller.ExpressoRequest;
+import com.jcorporate.expresso.core.controller.ExpressoResponse;
 import com.jcorporate.expresso.core.controller.DBController;
 import com.jcorporate.expresso.core.controller.ErrorCollection;
 import com.jcorporate.expresso.core.controller.NonHandleableException;
@@ -93,6 +93,8 @@
 import javax.servlet.http.HttpServletResponse;
 import java.util.Enumeration;
 import java.util.Vector;
+import com.jcorporate.expresso.core.registry.MutableRequestRegistry;
+import com.jcorporate.expresso.core.security.ReadOnlyUser;
 
 /**
  * Main Login Controller - used for login/logout and basic interaction with
@@ -104,14 +106,15 @@
  *
  * @author Shash Chatterjee
  */
-public abstract class LoginController
-        extends DBController {
+public abstract class LoginController extends DBController
+{
 
     public static final String LOGINNAME_COOKIE = "UserName";
     public static final String PASSWORD_COOKIE = "Password";
     public static final String DBNAME_COOKIE = "db";
     public static final String CLASS_HANDLER_NAME = "login";
-    public static final String DEFAULT_CLASS_NAME = com.jcorporate.expresso.services.controller.SimpleLoginController.class.getName();
+    public static final String DEFAULT_CLASS_NAME = com.jcorporate.expresso.services.controller.SimpleLoginController.class.
+        getName();
 
     private static Logger log = Logger.getLogger(LoginController.class);
 
@@ -140,28 +143,59 @@
      * a problem with the login.  This method expects the HttpServletRequest to have
      * two parameters, LoginName and Password
      *
-     * @param request  The ControllerRequest handed off to a controller by the
+     * @param request  The ExpressoRequest handed off to a controller by the
      *                 framework
-     * @param response The ControllerResponse object
+     * @param response The ExpressoResponse object
      * @param errors   The system fills out the errors collection if there
      *                 are problems with the login itself.
-     * @param hreq     The "low level" version of ControllerRequest.  Allows direct
+     * @param hreq     The "low level" version of ExpressoRequest.  Allows direct
      *                 access to http components.
-     * @param hres     The "low level" version of ControllerResponse.  Allows direct
+     * @param hres     The "low level" version of ExpressoResponse.  Allows direct
      *                 access to the http HttpServletResponse.
      * @param session  The PersistantSession object to write the CurrentLogin response to
      * @return the uid of the user if successfully logged in
      * @throws ControllerException    upon logic error
      * @throws NonHandleableException upon a fatal error
      * @throws DBException            if there is database lookup problems
+     * @deprecated Since Expresso 5.7 Use tryLogin that returns ReadOnlyUser instead.
      */
-    protected int attemptLogin(ControllerRequest request,
-                               ControllerResponse response,
-                               ErrorCollection errors,
-                               HttpServletRequest hreq,
-                               HttpServletResponse hres,
-                               PersistentSession session)
-            throws ControllerException, NonHandleableException, DBException {
+    protected int attemptLogin(final ExpressoRequest request, final ExpressoResponse response
+        , final ErrorCollection errors, final HttpServletRequest hreq, final HttpServletResponse hres
+        , final PersistentSession session) throws ControllerException, NonHandleableException, DBException {
+
+        ReadOnlyUser result = tryLogin(request, response, errors, hreq, hres, session);
+        if (result == null) {
+            return 0;
+        } else {
+            return result.getUid();
+        }
+    }
+    /* attemptLogin */
+
+    /**
+     * Processes the login request.  Sets the errors collection if there's
+     * a problem with the login.  This method expects the HttpServletRequest to have
+     * two parameters, LoginName and Password
+     *
+     * @param request  The ExpressoRequest handed off to a controller by the
+     *                 framework
+     * @param response The ExpressoResponse object
+     * @param errors   The system fills out the errors collection if there
+     *                 are problems with the login itself.
+     * @param hreq     The "low level" version of ExpressoRequest.  Allows direct
+     *                 access to http components.
+     * @param hres     The "low level" version of ExpressoResponse.  Allows direct
+     *                 access to the http HttpServletResponse.
+     * @param session  The PersistantSession object to write the CurrentLogin response to
+     * @return the ReadOnlyUser instance if successfully logged in.
+     * @throws ControllerException    upon logic error
+     * @throws NonHandleableException upon a fatal error
+     * @throws DBException            if there is database lookup problems
+     */
+    protected ReadOnlyUser tryLogin(final ExpressoRequest request, final ExpressoResponse response,
+        final ErrorCollection errors, final HttpServletRequest hreq, final HttpServletResponse hres
+        , final PersistentSession session
+        ) throws DBException, ControllerException {
         try {
             int uid = 0;
             User myUser = new User();
@@ -169,8 +203,8 @@
             String loginName = StringUtil.notNull(request.getParameter("LoginName"));
 
             if (loginName.equals("")) {
-                errors.addError("error.nologinname");	// You did not enter a login name, please go back and correct that
-                return uid;
+                errors.addError("error.nologinname"); // You did not enter a login name, please go back and correct that
+                return null;
             }
 
             myUser.setLoginName(loginName);
@@ -189,7 +223,7 @@
                 logInvalidLoginAttempt(response.getString("error.invalidusername"), request);
                 delayLogin();
 
-                return uid;
+                return null;
             }
 
             // now that user is retrieved, compare the password
@@ -204,7 +238,7 @@
                 logInvalidLoginAttempt(response.getString("error.invalidusername"), request);
                 delayLogin();
 
-                return uid;
+                return null;
             }
 
             uid = myUser.getUid();
@@ -216,7 +250,7 @@
                 String currDescrip = "Unknown Status '" + currStatus + "'";
                 Vector v = myUser.getValidValues("AccountStatus");
 
-                for (Enumeration ev = v.elements(); ev.hasMoreElements();) {
+                for (Enumeration ev = v.elements(); ev.hasMoreElements(); ) {
                     vv = (ValidValue) ev.nextElement();
 
                     if (vv.getValue().equals(currStatus)) {
@@ -225,12 +259,12 @@
                 }
 
                 this.logInvalidLoginAttempt(response.getString("error.login.invalidlogin", loginName, currDescrip),
-                        request);
+                    request);
 
-                errors.addError("error.login.invalidlogin", loginName, currDescrip);	// Account + loginName + is + currDescrip
+                errors.addError("error.login.invalidlogin", loginName, currDescrip); // Account + loginName + is + currDescrip
                 delayLogin(); //Make 'em wait to save on server resources.
 
-                return uid;
+                return null;
             }
 
             ///////////////////////////////////////////////
@@ -242,15 +276,19 @@
 // "real" login name as found in the database
             User user;
             try {
+                String dataContext = request.getDataContext();
                 user = new User();
-                user.setDataContext(request.getDataContext());
+                user.setDataContext(dataContext);
                 user.setUid(uid);
                 if (!user.find()) {
                     log.error(
-                            "runDoLoginState unexpectedly cannot find user (after successful login!) for uid: " + uid);
+                        "runDoLoginState unexpectedly cannot find user (after successful login!) for uid: " + uid);
                 } else {
                     loginName = user.getLoginName();
                 }
+
+                //Set the request registry.
+                new MutableRequestRegistry(dataContext, user);
             } catch (DBException e) {
                 log.error("Unexpectedly cannot find user" + e);
                 throw e;
@@ -260,7 +298,6 @@
                 log.info("Successful login for user: " + loginName);
             }
 
-
             // write cookie; write password if user has chosen this option
             /**
              * @todo write a internally-maintained, expiring key INSTEAD of password
@@ -271,22 +308,20 @@
             } else { /* if we don't remember, clear the cookie */
                 setCookie(User.UNKNOWN_USER, "NONE", hres, true, request.getDataContext());
                 response.add(new Output("remembered",
-                        response.getString("Login_Not_Remembered")));
-            } /* if we remember */
-
+                    response.getString("Login_Not_Remembered")));
+            }
+            /* if we remember */
 
-            request.setUser(loginName);
-            request.setUid(uid);
             // set params
             setPersistentLoginAttributes(request, loginName);
 
-
-            return uid;
+            return user;
         } catch (Throwable t) {
             log.error("Exception caught attempting login", t);
             throw new ControllerException("Error while attempting login processing", t);
         }
-    } /* attemptLogin */
+
+    }
 
     /**
      * after successful authentication, set all the necessary parameters in session
@@ -299,11 +334,12 @@
      * this method made static 3/03 in order to allow external authentication;
      * should be changed to plug-in model when available in v. 5.1 and thereafter
      *
-     * @param request   The ControllerRequest object for this request
+     * @param request   The ExpressoRequest object for this request
      * @param loginName the login name which has been (potentially) corrected to match case in DB, even if DB matches on any lower/upper case
      * @throws ControllerException upon error
      */
-    public static void setPersistentLoginAttributes(ControllerRequest request, String loginName) throws ControllerException {
+    public static void setPersistentLoginAttributes(final ExpressoRequest request
+        , final String loginName) throws ControllerException {
         PersistentSession session = request.getSession();
         ServletControllerRequest sHreq = (ServletControllerRequest) request;
         HttpServletRequest hreq = sHreq.getHttpServletRequest();
@@ -314,9 +350,9 @@
         session.removePersistentAttribute(CurrentLogin.LOGIN_KEY);
 
         CurrentLogin myLogin = CurrentLogin.newInstance(loginName,
-                hreq.getRemoteAddr(),
-                request.getDataContext(),
-                request.getUid());
+            hreq.getRemoteAddr(),
+            request.getDataContext(),
+            request.getUid());
 
         session.setPersistentAttribute(CurrentLogin.LOGIN_KEY, myLogin);
 
@@ -340,10 +376,9 @@
      * @param dbname   The data context to set the login for.
      * @throws ControllerException if a database error occurs
      */
-    public static void setCookie(String userName,
-                                 String password,
-                                 HttpServletResponse res, boolean clear, String dbname)
-            throws ControllerException {
+    public static void setCookie(final String userName,
+        final String password,
+        final HttpServletResponse res, final boolean clear, final String dbname) throws ControllerException {
         try {
             final int THIRTY_DAYS_IN_SECS = 2592000;
             Cookie c1;
@@ -385,7 +420,7 @@
                 c3.setMaxAge(10);
             } else {
                 c3 = new Cookie(DBNAME_COOKIE,
-                        CookieUtil.cookieEncode(dbname));
+                    CookieUtil.cookieEncode(dbname));
                 c3.setMaxAge(THIRTY_DAYS_IN_SECS); /* 30 days */
             }
 
@@ -394,7 +429,8 @@
         } catch (Exception ce) {
             throw new ControllerException(ce);
         }
-    } /* setCookie(String, String, HttpServletRequest, HttpServletResponse, boolean) */
+    }
+    /* setCookie(String, String, HttpServletRequest, HttpServletResponse, boolean) */
 
     /**
      * Prefereable method to call if you already have a controller instance. Use
@@ -418,8 +454,7 @@
      * @return an instantiated LoginController
      * @throws ControllerException if there's an error instantiating the LoginController
      */
-    public static Controller getLoginController()
-            throws ControllerException {
+    public static Controller getLoginController() throws ControllerException {
         String className = ConfigManager.getClassHandler(CLASS_HANDLER_NAME);
         if (className == null || className.length() == 0) {
             className = DEFAULT_CLASS_NAME;
@@ -450,7 +485,7 @@
      * @param msg     The main message to log.
      * @param request If it happens to be a ServletControllerRequest
      */
-    public void logInvalidLoginAttempt(String msg, ControllerRequest request) {
+    public void logInvalidLoginAttempt(final String msg, final ExpressoRequest request) {
         String remoteIP = "";
         try {
             remoteIP = ((ServletControllerRequest) request).getServletRequest().getRemoteAddr();
@@ -471,12 +506,11 @@
     /**
      * Override this class to do some post processing in your derived controllers.
      *
-     * @param request  The ControllerRequest Object
-     * @param response The ControllerResponse Object
+     * @param request  The ExpressoRequest Object
+     * @param response The ExpressoResponse Object
      * @throws ControllerException upon error processing the post login information
      */
-    public void postLoginProcessing(ControllerRequest request, ControllerResponse response)
-            throws ControllerException {
+    public void postLoginProcessing(final ExpressoRequest request, final ExpressoResponse response) throws ControllerException {
         return;
     }
 
@@ -489,17 +523,16 @@
      * @return true if the state is allowed for the currently logged in user.
      * @throws ControllerException if there is an error while looking up the sercurity permissions
      */
-    public boolean stateAllowed(String newState,
-                                ControllerRequest params)
-            throws ControllerException {
+    public boolean stateAllowed(final String newState, final ExpressoRequest params) throws ControllerException {
         if (newState.equals("promptChangePW") ||
-                newState.equals("processChangePW") ||
-                newState.equals("promptLogout")) {
+            newState.equals("processChangePW") ||
+            newState.equals("promptLogout")) {
             return super.stateAllowed(newState, params);
         }
 
         return true;
-    } /* stateAllowed(String) */
+    }
+    /* stateAllowed(String) */
 
 
 }
Index: Registration.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/Registration.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/Registration.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/Registration.java -u -r1.51 -r1.52
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/Registration.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/Registration.java
@@ -69,16 +69,22 @@
  */
 package com.jcorporate.expresso.services.controller;
 
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.servlet.http.HttpServletRequest;
 import com.jcorporate.expresso.core.controller.ControllerException;
-import com.jcorporate.expresso.core.controller.ControllerRequest;
-import com.jcorporate.expresso.core.controller.ControllerResponse;
+import com.jcorporate.expresso.core.controller.ExpressoRequest;
+import com.jcorporate.expresso.core.controller.ExpressoResponse;
 import com.jcorporate.expresso.core.controller.ServletControllerRequest;
 import com.jcorporate.expresso.core.db.DBException;
 import com.jcorporate.expresso.core.dbobj.DBObject;
 import com.jcorporate.expresso.core.dbobj.SecuredDBObject;
 import com.jcorporate.expresso.core.misc.ConfigManager;
 import com.jcorporate.expresso.core.misc.StringUtil;
+import com.jcorporate.expresso.core.registry.RequestRegistry;
 import com.jcorporate.expresso.core.security.DelayThread;
+import com.jcorporate.expresso.core.security.SuperUser;
 import com.jcorporate.expresso.core.security.User;
 import com.jcorporate.expresso.services.dbobj.RegistrationDomain;
 import com.jcorporate.expresso.services.dbobj.RegistrationObjectMap;
@@ -86,16 +92,6 @@
 import com.jcorporate.expresso.services.validation.ValidationEntry;
 import org.apache.log4j.Logger;
 
-import javax.servlet.http.HttpServletRequest;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import com.jcorporate.expresso.core.security.SuperUser;
-import com.jcorporate.expresso.core.controller.ExpressoRequest;
-import com.jcorporate.expresso.core.registry.RequestRegistry;
-import com.jcorporate.expresso.core.security.ReadOnlyUser;
-import com.jcorporate.expresso.core.controller.ExpressoResponse;
-
 /**
  * <p>Registration Controller.  Provides services for self-registering people... ie
  * sign-up pages on websites.  This is the abstract class from which all Registration class
@@ -109,8 +105,8 @@
  * </ul>
  */
 
-public abstract class Registration
-        extends com.jcorporate.expresso.core.controller.DBController {
+public abstract class Registration extends com.jcorporate.expresso.core.controller.DBController
+{
 
     private static Logger log = Logger.getLogger(Registration.class.getName());
 
@@ -128,27 +124,25 @@
      * @return A built User object for this session.
      * @throws ControllerException upon error.
      */
-    protected User getRegUser(ExpressoRequest request)
-            throws ControllerException {
-
+    protected User getRegUser(final ExpressoRequest request) throws ControllerException {
 
         User user = null;
 
         try {
-            user = (User)RequestRegistry.getUser();
+            user = (User) RequestRegistry.getUser();
             user = new User();
 
             if (!user.find()) {
                 throw new ControllerException("Account \"" + user.getLoginName() +
-                        "\" not found");
+                    "\" not found");
             }
 
             if (user.getAccountStatus().equals("D")) {
                 throw new ControllerException("Account \"" + user.getLoginName() +
-                        "\" has been disabled");
+                    "\" has been disabled");
             } else if (user.getAccountStatus().equals("I")) {
                 throw new ControllerException("Account \"" + user.getLoginName() +
-                        "\" has not been activated yet");
+                    "\" has not been activated yet");
             }
         } catch (DBException dbe) {
             throw new ControllerException("Database access error for  user" + user.toString(), dbe);
@@ -168,8 +162,8 @@
      * @throws ControllerException upon error.
      * @throws DBException upon database error.
      */
-    protected boolean checkRegComplete(ExpressoRequest request, int uid)
-            throws DBException, ControllerException {
+    protected boolean checkRegComplete(final ExpressoRequest request, final int uid) throws DBException
+        , ControllerException {
         User myUser = new User();
         myUser.setDataContext(request.getDataContext());
         myUser.setUid(uid);
@@ -191,12 +185,12 @@
         boolean regComplete = true;
         RegistrationObjectMap oneMap = null;
 
-        for (Iterator i = rm.searchAndRetrieveList().iterator(); i.hasNext();) {
+        for (Iterator i = rm.searchAndRetrieveList().iterator(); i.hasNext(); ) {
             oneMap = (RegistrationObjectMap) i.next();
 
             int min = oneMap.getFieldInt("RecMin");
             SecuredDBObject oneObj = loadDBObject(request,
-                    oneMap.getField("RegObj"));
+                oneMap.getField("RegObj"));
             oneObj.setField(oneMap.getField("UidField"), uid);
 
             if (oneObj.count() < min) {
@@ -232,8 +226,7 @@
      * @throws ControllerException If the field format information could not be
      *                             determined
      */
-    protected String displayValue(String fieldType, String fieldValue)
-            throws ControllerException {
+    protected String displayValue(final String fieldType, final String fieldValue) throws ControllerException {
         try {
             if (fieldType.equalsIgnoreCase("money")) {
                 if (!fieldValue.equals("")) {
@@ -244,12 +237,13 @@
             }
         } catch (NumberFormatException ne) {
             throw new ControllerException("Number for field not in a " +
-                    "valid numeric format:" +
-                    fieldValue, ne);
+                "valid numeric format:" +
+                fieldValue, ne);
         }
 
         return null;
-    } /* displayValue(String, String) */
+    }
+    /* displayValue(String, String) */
 
 
     /**
@@ -259,8 +253,7 @@
      * @return the data context name that we're supposed to register with
      * @throws ControllerException upon error.
      */
-    public String getDB(ExpressoRequest request)
-            throws ControllerException {
+    public String getDB(final ExpressoRequest request) throws ControllerException {
         String dbobj = StringUtil.notNull(request.getParameter("dbobj"));
 
         if (dbobj.equals("")) {
@@ -271,14 +264,13 @@
     }
 
 
-
     /**
      * ?????
      *
      * @param fieldName ????
      * @return currently null
      */
-    protected String getDefaultValue(String fieldName) {
+    protected String getDefaultValue(final String fieldName) {
         return null;
     }
 
@@ -292,9 +284,8 @@
      * @return a built registration domain object
      * @throws ControllerException upon error.
      */
-    protected RegistrationDomain getRegDomain(ExpressoRequest request,
-                                              User user)
-            throws ControllerException {
+    protected RegistrationDomain getRegDomain(final ExpressoRequest request
+        , final User user) throws ControllerException {
         RegistrationDomain rd = null;
 
         try {
@@ -305,7 +296,7 @@
 
             if (!rd.find()) {
                 throw new ControllerException("Domain " + domain +
-                        " not created yet");
+                    " not created yet");
             }
         } catch (DBException dbe) {
             throw new ControllerException("Database error", dbe);
@@ -323,9 +314,8 @@
      * @return a fully instantiated SecuredDbObject
      * @throws ControllerException upon error.
      */
-    protected SecuredDBObject loadDBObject(ExpressoRequest request,
-                                           String dbobj)
-            throws ControllerException {
+    protected SecuredDBObject loadDBObject(final ExpressoRequest request
+        , final String dbobj) throws ControllerException {
         SecuredDBObject db = null;
 
         try {
@@ -350,13 +340,12 @@
      *         to be filled out for registration
      * @throws ControllerException upon error.
      */
-    public String nextToAdd(ExpressoRequest request)
-            throws ControllerException {
+    public String nextToAdd(final ExpressoRequest request) throws ControllerException {
         try {
             if (log.isDebugEnabled()) {
                 log.debug("Checking if user '" + RequestRegistry.getUser().getLoginName() +
-                        "' is fully registered, db '" + request.getDataContext() +
-                        "'");
+                    "' is fully registered, db '" + request.getDataContext() +
+                    "'");
             }
 
             User user = new User();
@@ -365,7 +354,7 @@
             user.retrieve();
             if (log.isDebugEnabled()) {
                 log.debug("Checking registration for used id '" + user.getUid() +
-                        "'");
+                    "'");
             }
 
             RegistrationDomain rd = new RegistrationDomain();
@@ -374,8 +363,8 @@
 
             if (!rd.find()) {
                 throw new ControllerException("Domain " +
-                        user.getRegistrationDomain() +
-                        " not created yet");
+                    user.getRegistrationDomain() +
+                    " not created yet");
             }
 
             RegistrationObjectMap rom = new RegistrationObjectMap();
@@ -385,10 +374,9 @@
             RegistrationObjectMap oneRom = null;
 
             for (Iterator e = rom.searchAndRetrieveList("RegOrder").iterator();
-                 e.hasNext();) {
+                e.hasNext(); ) {
                 oneRom = (RegistrationObjectMap) e.next();
 
-
                 DBObject db = isRegistrationObjectNeeded(request, user, oneRom);
 
                 if (db != null) {
@@ -413,9 +401,8 @@
      * @throws DBException upon database error.
      */
     protected DBObject isRegistrationObjectNeeded(final ExpressoRequest request,
-                                                  final User user,
-                                                  final RegistrationObjectMap rom)
-            throws DBException {
+        final User user,
+        final RegistrationObjectMap rom) throws DBException {
 
         int min;
         int records = 0;
@@ -424,10 +411,9 @@
         rom.setDataContext(request.getDataContext());
         min = rom.getFieldInt("RecMin");
 
-
         if (log.isDebugEnabled()) {
             log.debug("Need at least " + min + " records for '" +
-                    rom.getField("RegObj") + "'");
+                rom.getField("RegObj") + "'");
         }
 
         try {
@@ -435,8 +421,8 @@
         } catch (Exception ex) {
             log.error("isRegistrationObjectNeeded() Dynanamic load failed.", ex);
             throw new DBException("Dynamic load failed for " +
-                    rom.getField("RegObj"),
-                    ex);
+                rom.getField("RegObj"),
+                ex);
         }
 
         returnObject.setDataContext(request.getDataContext());
@@ -446,8 +432,8 @@
             returnObject.setField(fieldName, user.getUid());
             if (log.isDebugEnabled()) {
                 log.debug("Looking for '" + returnObject.getClass().getName() +
-                        "' record with " + fieldName + " = " +
-                        user.getUid() + " in db " + request.getDataContext());
+                    "' record with " + fieldName + " = " +
+                    user.getUid() + " in db " + request.getDataContext());
             }
 
             records = returnObject.count();
@@ -459,8 +445,8 @@
         if (records < min) {
             if (log.isDebugEnabled()) {
                 log.debug("There were '" + records + "' records, but " +
-                        min + " are required for '" +
-                        returnObject.getClass().getName() + "'");
+                    min + " are required for '" +
+                    returnObject.getClass().getName() + "'");
             }
 
             return returnObject;
@@ -468,8 +454,8 @@
         } else {
             if (log.isDebugEnabled()) {
                 log.debug("There were '" + records + "' records for " +
-                        returnObject.getClass().getName() +
-                        ", so we don't need any more.");
+                    returnObject.getClass().getName() +
+                    ", so we don't need any more.");
             }
 
             return null;
@@ -489,17 +475,15 @@
      * @throws DBException if there's an error mapping the registration domains
      *                     and building the DBObjects.
      */
-    protected DBObject[] getRequiredDBObjects(ExpressoRequest request,
-                                              RegistrationDomain rd,
-                                              User user)
-            throws DBException {
+    protected DBObject[] getRequiredDBObjects(final ExpressoRequest request, final RegistrationDomain rd
+        , final User user) throws DBException {
 
         ArrayList dbobjects = new ArrayList();
 
         if (log.isDebugEnabled()) {
             log.debug("Getting the registration objects that user '" + request.getUid() +
-                    "' needs, db='" + request.getDataContext() +
-                    "'");
+                "' needs, db='" + request.getDataContext() +
+                "'");
         }
 
 //
@@ -518,8 +502,8 @@
 
         if (!rd.find()) {
             throw new DBException("Domain " +
-                    user.getRegistrationDomain() +
-                    " not created yet");
+                user.getRegistrationDomain() +
+                " not created yet");
         }
 
         RegistrationObjectMap rom = new RegistrationObjectMap(SuperUser.INSTANCE);
@@ -529,10 +513,9 @@
         RegistrationObjectMap oneRom = null;
 
         for (Iterator e = rom.searchAndRetrieveList("RegOrder").iterator();
-             e.hasNext();) {
+            e.hasNext(); ) {
             oneRom = (RegistrationObjectMap) e.next();
 
-
             DBObject db = isRegistrationObjectNeeded(request, user, oneRom);
 
             if (db != null) {
@@ -557,16 +540,16 @@
      *                parameter.
      * @return The classname of the login controller to use.
      */
-    protected String getLoginController(ExpressoRequest request) {
+    protected String getLoginController(final ExpressoRequest request) {
         final String defaultController = com.jcorporate.expresso.services.controller
-                .LoginController.class.getName();
+            .LoginController.class.getName();
         boolean defaultValue = false;
         String controller = request.getParameter("login");
         if (controller == null) {
             defaultValue = true;
             try {
                 controller = this.getSchemaInstance()
-                        .getLoginController().getClass().getName();
+                    .getLoginController().getClass().getName();
             } catch (ControllerException ex) {
                 controller = defaultController;
             }
@@ -578,11 +561,11 @@
         if (!defaultValue) {
             try {
                 ConfigManager.getControllerFactory()
-                        .getController(controller);
+                    .getController(controller);
             } catch (Exception e) {
                 log.error("Unable to instantiate login controller: "
-                        + controller +
-                        " .  Using default login controller instead", e);
+                    + controller +
+                    " .  Using default login controller instead", e);
 
                 controller = defaultController;
             }
@@ -602,11 +585,8 @@
      * @throws DBException         upon data access error
      * @throws ControllerException for other errors
      */
-    protected void setupEmailValidation(ExpressoRequest request,
-                                        ExpressoResponse response, User user,
-                                        RegistrationDomain rd,
-                                        String loginControllerName)
-            throws DBException, ControllerException {
+    protected void setupEmailValidation(final ExpressoRequest request, final ExpressoResponse response, final User user
+        , final RegistrationDomain rd, final String loginControllerName) throws DBException, ControllerException {
 
         String emailAuthCode = user.getEmailAuthCode();
         String loginName = user.getLoginName();
@@ -633,7 +613,7 @@
         } catch (AuthValidationException avex) {
             delayLogin();
             throw new ControllerException("Validation framework exception",
-                    avex);
+                avex);
         }
     }
 
Index: SimpleLoginController.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/SimpleLoginController.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/SimpleLoginController.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/SimpleLoginController.java -u -r1.37 -r1.38
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/SimpleLoginController.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/services/controller/SimpleLoginController.java
@@ -80,8 +80,8 @@
 import com.jcorporate.expresso.core.ExpressoConstants;
 import com.jcorporate.expresso.core.controller.Controller;
 import com.jcorporate.expresso.core.controller.ControllerException;
-import com.jcorporate.expresso.core.controller.ControllerRequest;
-import com.jcorporate.expresso.core.controller.ControllerResponse;
+import com.jcorporate.expresso.core.controller.ExpressoRequest;
+import com.jcorporate.expresso.core.controller.ExpressoResponse;
 import com.jcorporate.expresso.core.controller.ErrorCollection;
 import com.jcorporate.expresso.core.controller.Input;
 import com.jcorporate.expresso.core.controller.NonHandleableException;
@@ -107,6 +107,7 @@
 import com.jcorporate.expresso.services.validation.ValidationEntry;
 import com.jcorporate.expresso.core.registry.RequestRegistry;
 import com.jcorporate.expresso.core.registry.MutableRequestRegistry;
+import com.jcorporate.expresso.core.security.ReadOnlyUser;
 
 /**
  * Main Login Controller - used for login/logout and basic interaction with
@@ -194,12 +195,11 @@
      * then this method actually resets thepassword and sends notification.
      *
      * @param request  The framework controller request
-     * @param response The framework ControllerResponse object
+     * @param response The framework ExpressoResponse object
      * @throws ControllerException    upon logic error
      * @throws NonHandleableException upon fatal error
      */
-    protected void runEmailValidateState(ControllerRequest request,
-                                         ControllerResponse response)
+    protected void runEmailValidateState(final ExpressoRequest request, final ExpressoResponse response)
             throws ControllerException,
             NonHandleableException {
 // The db context for the user (Note: this is different from the Validation entry context, which
@@ -315,36 +315,38 @@
      * Processes the "change my password" request.
      *
      * @param request  The framework controller request
-     * @param response The framework ControllerResponse object
+     * @param response The framework ExpressoResponse object
      * @throws ControllerException    upon logic error
      * @throws NonHandleableException upon fatal error
      */
-    protected void runProcessChangePasswordState(ControllerRequest request,
-                                                 ControllerResponse response)
-            throws ControllerException,
-            NonHandleableException {
+    protected void runProcessChangePasswordState(final ExpressoRequest request, final ExpressoResponse response)
+            throws ControllerException, NonHandleableException {
         ErrorCollection errors = new ErrorCollection();
-        String loginName = request.getUser();
 
-        try {
-            User myUser = new User();
-            myUser.setDataContext(request.getDataContext());
-            myUser.setLoginName(loginName);
+        String loginName = "";
 
-            if (loginName.equals("") || loginName.equals(User.UNKNOWN_USER) ||
-                    !myUser.find()) {
+        try {
+            User myUser = null;
+            try {
+                myUser = (User) RequestRegistry.getUser();
+            } catch (ClassCastException ex) {
+                throw new NonHandleableException("Login Controller can only "
+                    + "handle instances of com.jcorporate.expresso.core.security.User for underlying security.");
+            }
+            loginName = myUser.getLoginName();
+            if (myUser.getLoginName().equals(User.UNKNOWN_USER) ||myUser == SuperUser.INSTANCE ) {
                 delayLogin(); //Slow 'em down
                 errors.addError(response.getString("error.login.mustloginchngpaswd"));
             } else if (!myUser.passwordEquals(StringUtil.notNull(request.getParameter("oldPassword")))) {
-                errors.addError(response.getString("error.login.passwordinvalid", loginName));
+                errors.addError(response.getString("error.login.passwordinvalid", myUser.getLoginName()));
             }
             if (errors.getErrorCount() < 1) {
                 if (!myUser.getAccountStatus().equals("A")) {
-                    log.warn("User \"" + loginName +
+                    log.warn("User \"" + myUser.getLoginName() +
                             "\" attempted changin password, denied because account status is \"" +
                             myUser.getAccountStatus() + "\"");
                     delayLogin(); //Slow 'em down
-                    errors.addError(response.getString("error.login.disablednochngpaswd", loginName));
+                    errors.addError(response.getString("error.login.disablednochngpaswd", myUser.getLoginName()));
                 }
             }
             if (errors.getErrorCount() < 1) {
@@ -402,12 +404,11 @@
      * if there's an error processing this system.
      *
      * @param request  The framework controller request
-     * @param response The framework ControllerResponse object
+     * @param response The framework ExpressoResponse object
      * @throws ControllerException    upon logic error
      * @throws NonHandleableException upon fatal error
      */
-    protected void runProcessLoginState(ControllerRequest request,
-                                        ControllerResponse response)
+    protected void runProcessLoginState(final ExpressoRequest request, final ExpressoResponse response)
             throws ControllerException,
             NonHandleableException {
         ErrorCollection errors = new ErrorCollection();
@@ -431,9 +432,14 @@
                 , "%", "");
         int uid = 0;
 
+        User loggedInUser = null;
         try {
-            uid = attemptLogin(request, response, errors, hreq,
+            loggedInUser = (User)tryLogin(request, response, errors, hreq,
                     hres, session);
+            uid = loggedInUser.getUid();
+            if (loggedInUser == null) {
+                throw new NonHandleableException("Assertion Error -- tryLogin returned null user");
+            }
         } catch (DBException dbe) {
             throw new ControllerException(dbe);
         } finally {
@@ -446,10 +452,10 @@
                 return;
             }
 
+
             ///////////////////////////////////////
             // good login
             ///////////////////////////////////////
-            request.setUser(loginName);
             if (log.isDebugEnabled()) {
                 log.debug("good login for uid: " + uid);
             }
@@ -564,14 +570,15 @@
      * Logs a user out of the system and invalidates their session.
      *
      * @param request  The framework controller request
-     * @param response The framework ControllerResponse object
+     * @param response The framework ExpressoResponse object
      * @throws ControllerException upon logic error
+     * @throws DBException upon database error.
      */
-    protected void runProcessLogoutState(ControllerRequest request,
-                                         ControllerResponse response)
-            throws ControllerException {
+    protected void runProcessLogoutState(final ExpressoRequest request, final ExpressoResponse response)
+            throws ControllerException, DBException {
         PersistentSession session = request.getSession();
-        String loginName = request.getUser();
+        ReadOnlyUser user = RequestRegistry.getUser();
+        String loginName = user.getLoginName();
         String successMessage = loginName + " has been logged out";
 
         if (loginName.equals("")) {
@@ -600,8 +607,8 @@
             log.error("Error properly invalidating a user's session.  Terminating", ex);
             throw new ControllerException("Error properly logging out.  Session terminated.", ex);
         }
-        //This should eventually be replaced by Request Registry
-        response.getRequest().setUser(User.UNKNOWN_USER);
+
+
 
         Transition pr = new Transition("promptSelfRegister", this.getDefaultRegistrationController());
         pr.addParam("dbContext", request.getDataContext());
@@ -631,10 +638,10 @@
      * Template Method pattern. override in subclasses as necessary
      *
      * @param request  The framework controller request
-     * @param response The framework ControllerResponse object
+     * @param response The framework ExpressoResponse object
      * @throws ControllerException upon error.
      */
-    public void postLogoutProcessing(ControllerRequest request, ControllerResponse response)
+    public void postLogoutProcessing(final ExpressoRequest request, final  ExpressoResponse response)
             throws ControllerException {
         //      * Template Method pattern. override in subclasses as necessary
     }
@@ -644,11 +651,11 @@
      * Process the "Please Send me a new password" state.
      *
      * @param request  The framework controller request
-     * @param response The framework ControllerResponse object
+     * @param response The framework ExpressoResponse object
      * @throws ControllerException    upon logic error
      * @throws NonHandleableException upon fatal error
      */
-    protected void runProcessSendPasswordState(ControllerRequest request,  ControllerResponse response)
+    protected void runProcessSendPasswordState(final ExpressoRequest request,  final ExpressoResponse response)
             throws ControllerException,
             NonHandleableException {
         //
@@ -792,11 +799,10 @@
      * Displays the 'change password' page.
      *
      * @param request  The framework controller request
-     * @param response The framework ControllerResponse object
+     * @param response The framework ExpressoResponse object
      * @throws ControllerException upon logic error
      */
-    protected void runPromptChangePasswordState(ControllerRequest request,
-                                                ControllerResponse response)
+    protected void runPromptChangePasswordState(final ExpressoRequest request, final ExpressoResponse response)
             throws ControllerException {
         response.clearFormCache();
 
@@ -859,13 +865,13 @@
     /**
      * Prompts the user for login.
      *
-     * @param request  The ControllerRequest object
-     * @param response The ControllerResponse object
+     * @param request  The ExpressoRequest object
+     * @param response The ExpressoResponse object
      * @throws ControllerException upon error.
+     * @throws DBException upon database error.
      */
-    protected void runPromptLoginState(ControllerRequest request,
-                                       ControllerResponse response)
-            throws ControllerException {
+    protected void runPromptLoginState(final ExpressoRequest request, final ExpressoResponse response)
+            throws ControllerException, DBException {
         PersistentSession session = request.getSession();
         Input dbContext = new Input("dbContext");
         String useDB = StringUtil.notNull(request.getParameter("dbContext"));
@@ -912,8 +918,9 @@
         String ln = StringUtil.notNull(response.getFormCache("LoginName"));
 
         if (ln.equals("")) {
-            ln = request.getUser();
+            ln = RequestRegistry.getUser().getLoginName();
         }
+
         if (ln.equals(User.UNKNOWN_USER)) {
             ln = "";
         }
@@ -1073,14 +1080,13 @@
     /**
      * This function prompts for email revalidation
      *
-     * @param request  The <code>ControllerRequest</code> object handed to us
+     * @param request  The <code>ExpressoRequest</code> object handed to us
      *                 by the framework.
-     * @param response The <code>ControllerResponse</code> object handed to us
+     * @param response The <code>ExpressoResponse</code> object handed to us
      *                 by the framework
      * @throws ControllerException upon error
      */
-    protected void runPromptRevalidateState(ControllerRequest request,
-                                            ControllerResponse response) throws ControllerException {
+    protected void runPromptRevalidateState(final ExpressoRequest request, final ExpressoResponse response) throws ControllerException {
         response.setTitle("Enter Email For Revalidation Request");
 
         response.addOutput(new Output("If there was a transient error in the email delivery" +
@@ -1100,15 +1106,14 @@
      * RegistrationController to do the actual resending of the validation
      * email.
      *
-     * @param request  The <code>ControllerRequest</code> object handed to us
+     * @param request  The <code>ExpressoRequest</code> object handed to us
      *                 by the framework.
-     * @param response The <code>ControllerResponse</code> object handed to us
+     * @param response The <code>ExpressoResponse</code> object handed to us
      *                 by the framework
      * @throws ControllerException    upon error
      * @throws NonHandleableException upon fatal error
      */
-    protected void runProcessRevalidateState(ControllerRequest request,
-                                             ControllerResponse response)
+    protected void runProcessRevalidateState(final ExpressoRequest request, final ExpressoResponse response)
             throws ControllerException, NonHandleableException {
         response.setTitle("Revalidation Processing");
         ErrorCollection ec = request.getErrorCollection();
@@ -1162,8 +1167,7 @@
     }
 
 
-    protected void runPromptSendPasswordState(ControllerRequest request,
-                                              ControllerResponse response)
+    protected void runPromptSendPasswordState(final ExpressoRequest request, final ExpressoResponse response)
             throws ControllerException {
         String dbContext = StringUtil.notNull(request.getParameter("dbContext"));
 
@@ -1205,7 +1209,7 @@
      * @throws ControllerException if there is an error while looking up the sercurity permissions
      */
     public synchronized boolean stateAllowed(String newState,
-                                             ControllerRequest params)
+                                             ExpressoRequest params)
             throws ControllerException {
         if (newState.equals("promptChangePW") ||
                 newState.equals("processChangePW") ||
Index: DeprecatedTestController.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/test-src/com/jcorporate/expresso/core/controller/tests/DeprecatedTestController.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lexpresso-web/WEB-INF/test-src/com/jcorporate/expresso/core/controller/tests/DeprecatedTestController.java -Lexpresso-web/WEB-INF/test-src/com/jcorporate/expresso/core/controller/tests/DeprecatedTestController.java -u -r1.1 -r1.2
--- expresso-web/WEB-INF/test-src/com/jcorporate/expresso/core/controller/tests/DeprecatedTestController.java
+++ expresso-web/WEB-INF/test-src/com/jcorporate/expresso/core/controller/tests/DeprecatedTestController.java
@@ -1,4 +1,6 @@
-package com.jcorporate.expresso.core.controller;
+package com.jcorporate.expresso.core.controller.tests;
+
+import com.jcorporate.expresso.core.controller.*;
 
 /**
 
Index: controllers.xml
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/expresso/doc/edg/controllers.xml,v
retrieving revision 1.30
retrieving revision 1.31
diff -Lexpresso-web/expresso/doc/edg/controllers.xml -Lexpresso-web/expresso/doc/edg/controllers.xml -u -r1.30 -r1.31
--- expresso-web/expresso/doc/edg/controllers.xml
+++ expresso-web/expresso/doc/edg/controllers.xml
@@ -421,7 +421,7 @@
 to another is how the controller gets it's work done.
 		</para>
 		<para>
-As a controller transitions to a new state, it generates a ControllerResponse
+As a controller transitions to a new state, it generates a ExpressoResponse
 object. This object contains a group of ControllerElement objects, of 4
 types:
 		</para>
@@ -833,7 +833,7 @@
 followed: the state method's name should be "run" followed by the name
 of the state followed by "State". For example, a state called "prompt"
 would look for a method called runPromptState. The state's method must
-take two parameters, a ControllerRequest followed by a ControllerResponse,
+take two parameters, a ExpressoRequest followed by a ExpressoResponse,
 both of which are passed to the method already initialized. The method
 must be declared void and should be protected to the Controller class itself.
 Separate State objects are often superior, as they allow a clean separation
@@ -879,13 +879,13 @@
    addState(dbobjmatrix);
 } /* DBSecurityMatrix() */
 
-ControllerResponse runPromptState(ControllerRequest request, ControllerResponse response)
+void runPromptState(final ExpressoRequest request, final ExpressoResponse response)
         throws ControllerException {
-    return response; 
+
 }
  
 /*
-  runPromptState(ControllerRequest, ControllerResponse);
+  runPromptState(ExpressoRequest, ExpressoResponse);
 */
 ]]></programlisting>
 			<para>
@@ -898,8 +898,8 @@
 To do this, you create a special function that follows a particular naming
 convention. The naming convention is similar to that of the JavaBeans naming
 convention, but with a twist to help maintain backwards compatibility.
-Name your function as run&lt;StateName with first letter capitalized&gt;State(ControllerRequest,
-ControllerResponse). If you keep to this convention, then Expresso will
+Name your function as run&lt;StateName with first letter capitalized&gt;State(ExpressoRequest,
+ExpressoResponse). If you keep to this convention, then Expresso will
 automatically find your internal state function through the use of the
 Java Reflection API's.
 			</para>
@@ -913,7 +913,7 @@
 older versions of Expresso you would have the following code in your internal
 state handler:
 					<programlisting><![CDATA[
-1. ControllerResponse runPromptState(ControllerRequest request, ControllerResponse response)
+1. void runPromptState(final ExpressoRequest request, ExpressoResponse response)
   throws ControllerException {
 2.  ServletControllerRequest scr = (ServletControllerRequest)request;
 3. /** Get HttpServlet Request through: scr.getHttpServletRequest() **/ .....
@@ -921,18 +921,17 @@
 				</para>
 				<para>
 
-Since Expresso 5.3, you can now simply change the signature of your state
+Since Expresso 5.6, you can now simply change the signature of your state
 handler to receive ServletControllerRequest directly:
 					<programlisting><![CDATA[
-ControllerResponse runPromptState(ServletControllerRequest request,
-                                  ControllerResponse response)
+void runPromptState(final ServletControllerRequest request, final ControllerResponse response)
         throws ControllerException { 
     /** Get HttpServlet Request through: request.getHttpServletRequest() **/
 
     .....
 }
 /*
-  runPromptState(ControllerRequest, ControllerResponse);
+  runPromptState(ServletControllerRequest, ControllerResponse);
 */]]></programlisting>
 				</para>
 				<para>
@@ -1036,7 +1035,7 @@
 From a state method within a controller it is very easy to transition to
 another state in the same Controller. Simply call: transition("newstate",
 req, res);, where "newstate" is the name of the new state (the state name,
-not the method name), and req and res are the ControllerRequest and ControllerResponse
+not the method name), and req and res are the ExpressoRequest and ExpressoResponse
 objects that were passed in to the method originally. It is important also
 to call "return" immediately after the transition, as you usually don't
 want to do any further processing in the current state.
@@ -1276,8 +1275,9 @@
    /**
     * Overridden state that simply adds an additional output to the response.
     */
-   protected void runPromptLoginState(ControllerRequest request,
-                                      ControllerResponse response) throws ControllerException {
+   protected void runPromptLoginState(final ExpressoRequest request,
+    final ExpressoResponseresponse) throws ControllerException {
+    
        super.runPromptLoginState(request,response); 
        response.add(new Output("myaddition","This is my added text message"); 
    }


More information about the cvs mailing list