if (paramIsPresent(canUseString))
if (Common.paramIsPresent(canUseString))
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();  ActionMessages actionMessages = null;  // 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();   boolean canUse;  boolean canGrant;  Date    effectiveDate   = null;  Date    expirationDate  = null;  PrivilegedSubject grantor    = (PrivilegedSubject)        (session.getAttribute("loggedInPrivilegedSubject"));  PrivilegedSubject grantee    = (PrivilegedSubject)        (session.getAttribute("currentGranteePrivilegedSubject"));  TreeNode scope = (TreeNode)(session.getAttribute("currentScope"));  Function function = (Function)(session.getAttribute("currentFunction"));    // currentAssignment is present in the session only if we are editing  // an existing Assignment. Otherwise, we're attempting to create a new one.  Assignment assignment    = (Assignment)(session.getAttribute("currentAssignment"));    Signet signet = (Signet)(session.getAttribute("signet"));    if (signet == null)  {    return (mapping.findForward("notInitialized"));  }    Common.showHttpParams    ("ConfirmAction.execute()", signet.getLogger(), request);    String canUseString = request.getParameter("can_use");  String canGrantString = request.getParameter("can_grant");  try  {    effectiveDate      = Common.getDateParam(request, Constants.EFFECTIVE_DATE_PREFIX, new Date());  }  catch (DataEntryException dee)  {    actionMessages      = addActionMessage          (request, actionMessages, Constants.EFFECTIVE_DATE_PREFIX);  }    try  {    expirationDate      = Common.getDateParam(request, Constants.EXPIRATION_DATE_PREFIX);  }  catch (DataEntryException dee)  {    actionMessages      = addActionMessage          (request, actionMessages, Constants.EXPIRATION_DATE_PREFIX);  }  if (paramIsPresent(canUseString))  {    canUse = true;  }  else  {    canUse = false;  }    if (paramIsPresent(canGrantString))  {    canGrant = true;  }  else  {    canGrant = false;  }    Set limitValues = LimitRenderer.getAllLimitValues(signet, request);    // If we've detected any data-entry errors, let's bail out here, before we  // try to use that bad data.  if (actionMessages != null)  {    return findDataEntryErrors(mapping);  }    if (assignment != null)  {    // We're editing an existing Assignment.    assignment.setLimitValues(grantor, limitValues);    assignment.setCanGrant(grantor, canGrant);    assignment.setCanUse(grantor, canUse);    assignment.setEffectiveDate(grantor, effectiveDate);    assignment.setExpirationDate(grantor, expirationDate);  }  else  {    // We're creating a new Assignment.    assignment      = grantor.grant          (null,  // actingAs           grantee,           scope,           function,           limitValues,           canUse,           canGrant,           effectiveDate,           expirationDate);  }    // Let's see whether or not the Assignment we want to save has any  // duplicates. If it does, we'll sidetrack the user with a warning  // screen.    Set duplicateAssignments = assignment.findDuplicates();  if (duplicateAssignments.size() > 0)  {    session.setAttribute("currentAssignment", assignment);    session.setAttribute("currentLimitValues", limitValues);    session.setAttribute("duplicateAssignments", duplicateAssignments);    return findDuplicateAssignments(mapping);  }    // If we've gotten this far, there must be no duplicate Assignments.  // Let's save this Assignment in the database.    signet.beginTransaction();  assignment.save();  signet.commit();    session.setAttribute("currentAssignment", assignment);  // Forward to our success page  return findSuccess(mapping);}