2 Replies Latest reply on Nov 12, 2007 12:19 PM by Pete Muir

    How inject List in Context

    Mirla Braga Newbie

      How inject List on Context?

      I want inject a List of Object on Context of the apllication. However happen error.

      
      @Name("mailExample")
      @Scope(ScopeType.SESSION)
      public class MailExample
      {
      
      @In
       @Out(scope=ScopeType.CONVERSATION)
       private List<Object> enderecos = null;
      
      // Ação do botão enviar
       public void send()
       {
       try
       {
       getNomeEndereco();
       renderer.render("/simple.xhtml");
       facesMessages.add("Email sent successfully");
       } catch (Exception e)
       {
       log.error("Error sending mail", e);
       facesMessages.add(FacesMessage.SEVERITY_INFO, "Email sending failed: " + e.getMessage());
       }
       }
      
       /**
       * @return the nomeEndereco
       */
       @Out
       public String getNomeEndereco()
       {
       nomeEndereco = new String("bragamoveis@gmail.com");
      
       return nomeEndereco;
       }
      
       /**
       * @param nomeEndereco the nomeEndereco to set
       */
       @In
       @Factory("nomeEndereco")
       public void setNomeEndereco(String nomeEndereco)
       {
       this.nomeEndereco = new String("email@gmail.com");
       }
      
      


        • 1. Re: How inject List in Context
          Mirla Braga Newbie

           

          "mirlabraga" wrote:
          How inject List on Context?

          I want inject a List of Object on Context of the apllication. However happen error.

          
          
          @Name("mailExample")
          @Scope(ScopeType.SESSION)
          public class MailExample
          {
          
          @In
           @Out(scope=ScopeType.CONVERSATION)
           private List<Object> enderecos = null;
          
          // Ação do botão enviar
           public void send()
           {
           try
           {
           getNomeEndereco();
           renderer.render("/simple.xhtml");
           facesMessages.add("Email sent successfully");
           } catch (Exception e)
           {
           log.error("Error sending mail", e);
           facesMessages.add(FacesMessage.SEVERITY_INFO, "Email sending failed: " + e.getMessage());
           }
           }
          
           /**
           * @return the nomeEndereco
           */
           @Out
           public String getNomeEndereco()
           {
           nomeEndereco = new String("bragamoveis@gmail.com");
          
           return nomeEndereco;
           }
          
           /**
           * @param nomeEndereco the nomeEndereco to set
           */
           @In
           @Factory("nomeEndereco")
           public void setNomeEndereco(String nomeEndereco)
           {
           this.nomeEndereco = new String("email@gmail.com");
           }
          
          



          The error:

          Caused by: javax.mail.internet.AddressException: Missing final '@domain' in string ``''
          


          No found the string....because Itsn't on context.

          Help me

          Please

          • 2. Re: How inject List in Context
            Pete Muir Master

            So one of the addresses on your mail message. Post the template.