org.davesag.generica.servlet.action
Class ChooseHomepageAction
java.lang.Object
org.apache.struts.action.Action
org.davesag.generica.servlet.action.AbstractAction
org.davesag.generica.servlet.action.ChooseHomepageAction
- public class ChooseHomepageAction
- extends AbstractAction
This action determines if the current user has logged in and forwards to the
correct home page or the login page depending on the class of User you are.
- Since:
- Generica 1.0
- Version:
- CVS Revision $Id: ChooseHomepageAction.java,v 1.18 2004/03/30 13:00:41 davesag Exp $
- Author:
- Dave Sag
http://www.davesag.com
- See Also:
HomepageChooser
| Fields inherited from class org.apache.struts.action.Action |
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY |
| Methods inherited from class org.davesag.generica.servlet.action.AbstractAction |
abortTransaction, commitTransaction, furtherActions, genericActions, getApplication, getController, getController, getHibernateSession, getLocale, getMessages, getNextForward, openTransaction, presentation, saveActionErrors, setNextForward |
| Methods inherited from class org.apache.struts.action.Action |
execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChooseHomepageAction
public ChooseHomepageAction()
execute
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
- When a homepage, or login page is requested we must check if a User has
logged in, and forward them to the right spot. The action will usually
look for a mapping forward called "
loggedout" in the
struts-config.cml file, that represents the page to forward
control to if the user is not logged in. This action will load an
appropriate HomepageChooser to decide where to send a logged in user, depending on
its class. Note the is homepages are special because they are the only
pages of mixed public/private content that have a single url. also of
special note is that this action executes any specified actor or
presentation controllers whether logged in or out. if you want logic
specific to a logged in user then load the session when you login that
user using the UserLoginController. The rest should be split
up into /in/, /out/, /admin/ etc
subdomains where the AccessControlFilter can decided how to handle the request.
- Parameters:
mapping - The ActionMappingform - The Struts ActionFormrequest - The servlet request.response - The servlet response.
- Returns:
- an action forward.
- Throws:
Exception - if something broke.
Dave Sag Generica API version 0.5.9 - (prerelease) Copyright © 2003 - 2004 Dave Sag.