if (request.getRemoteUser() == null) { return findDemoLogin(mapping); }
  public ActionForward execute  	(ActionMapping				mapping,     ActionForm 					form,     HttpServletRequest 	request,     HttpServletResponse response)  throws Exception  {    // Setup message array in case there are errors    ArrayList messages = new ArrayList();    // Confirm message resources loaded    MessageResources resources = getResources(request);    if (resources==null)    {      messages.add(Constants.ERROR_MESSAGES_NOT_LOADED);    }    // If there were errors, forward to our failure page    if (messages.size()>0)    {      request.setAttribute(Constants.ERROR_KEY,messages);      return findFailure(mapping);    }        HttpSession session = request.getSession();        Signet signet = (Signet)(session.getAttribute("signet"));    if (signet == null)    {      signet = new Signet();      signet.setLogger(logger);      session.setAttribute("signet", signet);    }        PrivilegedSubject loggedInUser    	= (PrivilegedSubject)(session.getAttribute(Constants.LOGGEDINUSER_ATTRNAME));    if (loggedInUser == null)    {      // Find the PrivilegedSubject associated with the logged-in      // user, and stash it in the Session.      Set userMatches      	= signet.getPrivilegedSubjectsByDisplayId(      			Signet.DEFAULT_SUBJECT_TYPE_ID, request.getRemoteUser());            if (userMatches.size() != 1)      {      	messages.add        ("Found "             + userMatches.size()            + " matches for logged-in user with display-ID '"            + request.getRemoteUser()            + "'. We don't know what to do with any number other than one.");        messages.add("All matches:");        Iterator userMatchesIterator = userMatches.iterator();        while (userMatchesIterator.hasNext())        {          messages.add          (((PrivilegedSubject)(userMatchesIterator.next())).toString());        }        request.setAttribute(Constants.ERROR_KEY, messages);                return findFailure(mapping);      }            loggedInUser = null;      Iterator pSubjectsIterator = userMatches.iterator();      while (pSubjectsIterator.hasNext())      {        loggedInUser = (PrivilegedSubject)(pSubjectsIterator.next());      }            session.setAttribute(Constants.LOGGEDINUSER_ATTRNAME, loggedInUser);    }        PrivilegedSubject currentPrivilegedSubject      = Common.getAndSetPrivilegedSubject          (signet,           request,           Constants.CURRENTPSUBJECT_HTTPPARAMNAME, // paramName           Constants.CURRENTPSUBJECT_ATTRNAME,      // attrName           loggedInUser.getEffectiveEditor());      // defaultValue        PrivDisplayType currentPrivDisplayType      = Common.getAndSetPrivDisplayType          (request,           Constants.PRIVDISPLAYTYPE_HTTPPARAMNAME, // paramName           Constants.PRIVDISPLAYTYPE_ATTRNAME,      // attributeName           PrivDisplayType.CURRENT_GRANTED);        // default value        Subsystem currentSubsystem      = Common.getAndSetSubsystem          (signet,           request,           Constants.SUBSYSTEM_HTTPPARAMNAME, // paramName           Constants.SUBSYSTEM_ATTRNAME,      // attributeName           Constants.WILDCARD_SUBSYSTEM);     // default value        // Forward to our success page    return findSuccess(mapping);  }