Index: lams_common/src/java/org/lamsfoundation/lams/web/action/LamsAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/web/action/LamsAction.java,v diff -u -r1.1 -r1.2 --- lams_common/src/java/org/lamsfoundation/lams/web/action/LamsAction.java 3 Mar 2005 04:06:28 -0000 1.1 +++ lams_common/src/java/org/lamsfoundation/lams/web/action/LamsAction.java 21 Jul 2005 04:30:28 -0000 1.2 @@ -1,7 +1,23 @@ -/* - * Created on 7/02/2005 - * - */ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ package org.lamsfoundation.lams.web.action; import javax.servlet.http.HttpServletRequest; @@ -18,14 +34,8 @@ protected static String className = "Action"; - private static TokenProcessor token = TokenProcessor.getInstance(); - - private static String LOG_NAME = "lams.web.action.Logger"; - /** - * Logger used for action classes. - * TODO: revisit logging. - */ - protected static Logger log = Logger.getLogger(LOG_NAME); + protected static TokenProcessor token = TokenProcessor.getInstance(); + protected static Logger log = Logger.getLogger(LamsAction.class); protected void saveToken(javax.servlet.http.HttpServletRequest request) { token.saveToken(request); @@ -36,7 +46,7 @@ } protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request, boolean reset) { - return token.isTokenValid(request, reset); + return token.isTokenValid(request, reset); } protected void resetToken(HttpServletRequest request) { Index: lams_common/src/java/org/lamsfoundation/lams/web/action/LamsDispatchAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/web/action/LamsDispatchAction.java,v diff -u -r1.1 -r1.2 --- lams_common/src/java/org/lamsfoundation/lams/web/action/LamsDispatchAction.java 3 Mar 2005 04:06:28 -0000 1.1 +++ lams_common/src/java/org/lamsfoundation/lams/web/action/LamsDispatchAction.java 21 Jul 2005 04:30:28 -0000 1.2 @@ -1,7 +1,23 @@ -/* - * Created on 7/02/2005 - * - */ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ package org.lamsfoundation.lams.web.action; import javax.servlet.http.HttpServletRequest; @@ -18,14 +34,8 @@ protected static String className = "Action"; - private static TokenProcessor token = TokenProcessor.getInstance(); - - private static String LOG_NAME = "lams.web.action.Logger"; - /** - * Logger used for action classes. - * TODO: revisit logging. - */ - protected static Logger log = Logger.getLogger(LOG_NAME); + protected static TokenProcessor token = TokenProcessor.getInstance(); + protected static Logger log = Logger.getLogger(LamsDispatchAction.class); protected void saveToken(javax.servlet.http.HttpServletRequest request) { token.saveToken(request); Index: lams_common/src/java/org/lamsfoundation/lams/web/action/LamsLookupDispatchAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/web/action/LamsLookupDispatchAction.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/web/action/LamsLookupDispatchAction.java 21 Jul 2005 04:30:28 -0000 1.1 @@ -0,0 +1,68 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ +package org.lamsfoundation.lams.web.action; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; +import org.apache.struts.actions.LookupDispatchAction; +import org.lamsfoundation.lams.web.util.TokenProcessor; + +/** + * Extension to the Struts LookupDispatchAction. Differences: + *
    + *
  1. Uses the LAMS TokenProcessor rather than the Struts TokenProcessor + * Reason for this unknown as the coder who implemented it failed to say why! + *
+ * + * @author Fiona Malikoff + */ +public abstract class LamsLookupDispatchAction extends LookupDispatchAction { + + private static TokenProcessor token = TokenProcessor.getInstance(); + protected static Logger log = Logger.getLogger(LamsLookupDispatchAction.class); + + protected void saveToken(javax.servlet.http.HttpServletRequest request) { + token.saveToken(request); + } + + protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request) { + return token.isTokenValid(request, false); + } + + protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request, boolean reset) { + return token.isTokenValid(request, reset); + } + + protected void resetToken(HttpServletRequest request) { + token.resetToken(request); + } + + /*protected void saveForward(javax.servlet.http.HttpServletRequest request, ActionForward forward) { + token.saveForward(request, forward); + } + + protected ActionForward getForward(javax.servlet.http.HttpServletRequest request) { + return token.getForward(request, true); + }*/ + + +}