Package org.apache.struts.action

Examples of org.apache.struts.action.ActionError


       
       
    } catch (Exception e) {
      String eid=this.getClass().getName()+"_"+System.currentTimeMillis();
      log.error("eid:"+eid +"\nsessionID" +request.getSession().getId(),e;     
      errors.add("general"new ActionError("error.general","error id:"+eid));           
    }
   
    if (!errors.isEmpty()) {
      saveErrors(request, errors);
      return mapping.findForward("cancel");
View Full Code Here


         
          ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
          ProfileManager manager = forumFactory.getProfileManager();
          User u = manager.getUser(Integer.parseInt(request.getParameter("id")));
          manager.deleteUser(u);
          errors.add("general"new ActionError("delUser.confirm"));
         
        }
        catch( NotFoundException fnfe ) {
          errors.add("general"new ActionError("delUser.notFound"));         
        }
        catch( UnauthorizedException ue ) {
          errors.add("general"new ActionError("delUser.unauthorized"));
        }
       
    } catch (Exception e) {
      String eid=this.getClass().getName()+"_"+System.currentTimeMillis();
      log.error("eid:"+eid +"\nsessionID" +request.getSession().getId(),e;     
      errors.add("general"new ActionError("error.general","error id:"+eid));           
    }
   
    saveErrors(request, errors);

    return mapping.findForward("success");
View Full Code Here

        }
      }

     
    } catch (UnauthorizedException ue) {
      errors.add("general", new ActionError("addForumFilter.Unauthorized"));
    } catch (Exception e) {
      String eid = this.getClass().getName() + "_" + System.currentTimeMillis();
      log.error("eid:" + eid + "\nsessionID" + request.getSession().getId(), e);
      errors.add("general", new ActionError("error.general", "erreur id:" + eid));
    }

    if (!errors.isEmpty()) {
      saveErrors(request, errors);
      return mapping.findForward("cancel");
View Full Code Here

     
      t.deleteMessage(m);
     

    } catch (ForumNotFoundException e) {
      errors.add("general", new ActionError("content.forumNotFound"));
    } catch (ForumThreadNotFoundException e) {
      errors.add("general", new ActionError("content.threadNotFound"));
    } catch (UnauthorizedException ue) {
      errors.add("general", new ActionError("content.Unauthorized"));
    } catch (Exception e) {
      String eid = this.getClass().getName() + "_" + System.currentTimeMillis();
      log.error("eid:" + eid + "\nsessionID" + request.getSession().getId(), e);
      errors.add("general", new ActionError("error.general", "erreur id:" + eid));
    }

    if (!errors.isEmpty()) {
      saveErrors(request, errors);
      return mapping.findForward("cancel");
View Full Code Here

        // add user as an administrator of the group
        group.addMember(u);
       
       
    } catch (NotFoundException e) {
      errors.add("general"new ActionError("groupUser.error.notFound"));           
       
    } catch (Exception e) {
      String eid=this.getClass().getName()+"_"+System.currentTimeMillis();
      log.error("eid:"+eid+"\nsessionID" +request.getSession().getId(),e;     
      errors.add("general"new ActionError("error.general","erreur id:"+eid));           
    }
   
    if (!errors.isEmpty()) {
        saveErrors(request, errors);
      return mapping.findForward("success");
View Full Code Here

          }
         
         
        }
        catch( AlreadyExistsException aee ) {
          errors.add("general"new ActionError("addForum.alreadyExist"));
        }
        catch( UnauthorizedException aee ) {
          aee.printStackTrace();
          errors.add("general"new ActionError("addForum.unauthorized"));
          saveErrors(request, errors);
          return mapping.findForward("cancel");
        }
       
    } catch (Exception e) {
      String eid=this.getClass().getName()+"_"+System.currentTimeMillis();
      log.error("eid:"+eid+"\nsessionID" +request.getSession().getId(),e;     
      errors.add("general"new ActionError("error.general","erreur id:"+eid));           
    }
   
    if (!errors.isEmpty()) {
      saveErrors(request, errors);
      return (mapping.getInputForward());
View Full Code Here

          temp = (String) it.next();
          u.setProperty(temp, (String) ub.getProperties().get(temp));
        }
       
      } catch (AlreadyExistsException aee) {
        errors.add("general", new ActionError("addUser.alreadyExist"));
      } catch (UnauthorizedException aee) {
        errors.add("general", new ActionError("addUser.unauthorized"));
        return mapping.findForward("cancel");
      }

    } catch (Exception e) {
      String eid = this.getClass().getName() + "_" + System.currentTimeMillis();
      log.error("eid:" + eid + "\nsessionID" + request.getSession().getId(), e);
      errors.add("general", new ActionError("error.general", "erreur id:" + eid));
    }

    if (!errors.isEmpty()) {
      saveErrors(request, errors);
      return (mapping.getInputForward());
View Full Code Here

                    Integer tmpNumDays = null;
                    try {
                        tmpNumDays = new Integer(Integer.parseInt(numDays));
                    } catch (NumberFormatException nfe) {
                        errs.add("numDays",
                            new ActionError("resource.autodiscovery.ScheduleTab.error.numDays", numDays));
                    }
                }
            } else if (recurInterval.equals(RECUR_WEEKLY)) {
                Integer tmpNumWeeks = null;
                try {
                    tmpNumWeeks = new Integer(Integer.parseInt(numWeeks));
                } catch (NumberFormatException nfe) {
                    errs
                        .add("numWeeks", new ActionError("resource.autodiscovery.ScheduleTab.error.numWeeks", numWeeks));
                }

                // check that the user clicked at least one day of the week to occurr on
                if (recurrenceDay.length == 0) {
                    errs
                        .add("recurrenceDay", new ActionError("resource.autodiscovery.ScheduleTab.error.recurrenceDay"));
                }
            } else if (recurInterval.equals(RECUR_MONTHLY)) {
                Integer tmpNumMonths = null;
                try {
                    tmpNumMonths = new Integer(Integer.parseInt(numMonths));
                } catch (NumberFormatException nfe) {
                    errs.add("numMonths", new ActionError("resource.autodiscovery.ScheduleTab.error.numMonths",
                        numMonths));
                }
            }
        } /* if (null != recurInterval) { */

 
View Full Code Here

    ArrayList errorList = new ArrayList();
    doValidate(mapping, request, errorList);
    request.setAttribute("errors", errorList);
    if (!errorList.isEmpty()) {
      actionErrors = new ActionErrors();
      actionErrors.add(ActionErrors.GLOBAL_ERROR, new ActionError("global.error"));
    }
    return actionErrors;
  }
View Full Code Here

                (name, PageContext.REQUEST_SCOPE);
      if (value == null) {
    ;
      } else if (value instanceof String) {
    errors.add(ActionErrors.GLOBAL_ERROR,
                           new ActionError((String) value));
      } else if (value instanceof String[]) {
                String keys[] = (String[]) value;
                for (int i = 0; i < keys.length; i++)
                    errors.add(ActionErrors.GLOBAL_ERROR,
                               new ActionError(keys[i]));
            } else if (value instanceof ErrorMessages) {
    String keys[] = ((ErrorMessages) value).getErrors();
                if (keys == null)
                    keys = new String[0];
                for (int i = 0; i < keys.length; i++)
                    errors.add(ActionErrors.GLOBAL_ERROR,
                               new ActionError(keys[i]));
            } else if (value instanceof ActionErrors) {
                errors = (ActionErrors) value;
      }
        } catch (Exception e) {
            ;
  }
        if (errors.empty())
      return (EVAL_BODY_INCLUDE);

  // Render the error messages appropriately
  Locale locale = null;
  try {
      locale = (Locale) pageContext.getAttribute
    (Action.LOCALE_KEY, PageContext.SESSION_SCOPE);
  } catch (IllegalStateException e) {  // Invalidated session
      locale = null;
  }
  if (locale == null)
      locale = defaultLocale;
  MessageResources messages = (MessageResources)
    pageContext.getAttribute(Action.MESSAGES_KEY,
           PageContext.APPLICATION_SCOPE);
  String message = null;
  StringBuffer results = new StringBuffer();
  message = messages.getMessage(locale, "errors.header");
  if (message != null) {
      results.append(message);
      results.append("\r\n");
  }
        Iterator reports = errors.get();
        while (reports.hasNext()) {
            ActionError report = (ActionError) reports.next();
      message =
                messages.getMessage(locale,
                                    report.getKey(), report.getValues());
      if (message != null) {
    results.append(message);
    results.append("\r\n");
      }
  }
View Full Code Here

TOP

Related Classes of org.apache.struts.action.ActionError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.