1 2 Previous Next 16 Replies Latest reply on Jan 28, 2008 6:59 AM by Alessandro Lazarotti

    Exceptions ending conversations

    Alessandro Lazarotti Newbie

      Hi !

      I'm using exception handling (by annotation and / or pages.xml) of Seam, but when an exception is launched, the classes that are in long-running conversation are discarded.

      Why this happens?

      
      /*
       * Exception class
       */
      @Redirect(viewId="/module/anypage.xhtml", message="Unexpected error")
      public class NoSelectionException extends RuntimeException{
      
      
       private static final String MESSAGE = "Nenhum dado foi selecionado";
       private String keyDefault = "error.nenhumDadoSelecionado";
      
       private ArrayList keys = new ArrayList();
      
      
       public NoSelectionException ()
       {
       super(MESSAGE);
      
       }
      
       //more codes
       ....
      
      
      
      /*
       * Service class
       */
      
      @Name("paService")
      @AutoCreate
      public class PaService {
      
       public String delete(List<Pa> pasSelecteds) {
      
       if (pasSelecteds == null || pasSelecteds.size() == 0)
       throw new NoSelectionException();
      
       paRepository.removePas(pasSelecteds);
      
       return "exibir";
       }
      
      }


        1 2 Previous Next