2 Replies Latest reply on Feb 22, 2010 6:23 PM by prati

    Conversation issue (Without Stateful bean)

    prati
      @Entity
      @Table(name="User")
      @Name("user")


      public class User  implements Serializable {

           private static final long serialVersionUID = 1L;
           private Long userId;
           private String userName;
           private String password;
           private String passwordSalt;
           private String screenName;
           private Set<Role> userRoles = new HashSet<Role>();
      .....
      }

      @Entity
      @Table(name = "Role")
      public class Role  implements Serializable{
           
           private int roleId;
           private String roleName;
      ....

      }


      and my Action bean(Its not Stateful bean)
      @Name("registerAction")
      @Scope(ScopeType.CONVERSATION)
      public class RegisterAction implements Serializable {

           /**
            *
            */
           private static final long serialVersionUID = 1L;

           @In
           private IdentityManager identityManager;

           
           @In
           private EntityManager entityManager;
      }


      The issue is Conversation is not working at all.

      Am i missing something

      Thanks in advance

      P

        • 1. Re: Conversation issue (Without Stateful bean)
          aravindkosuri

          Your problem is not clear. Elaborate issue. What do you mean Conversation is not working at all?


          Does it mean you are not getting your conversation scope data?


          Have you specified propagation as begin when you submit request? (If you like to start new propagation)

          • 2. Re: Conversation issue (Without Stateful bean)
            prati
            Hi

            This is my User class

            @Entity
            @Table(name="User")
            @Name("user")

            public class User  implements Serializable {

                 private static final long serialVersionUID = 1L;
                 private Long userId;
                 private String userName;
                 private String password;
            }

            I have UserLogin.html page which has got two textboxes
            UserName and password

            Then in UserLogin.java i capture username and password
            @In(create=true) User user;

            if i do System.out.println(user.getUserName )in onSubmit event it gives me null


            However if i add @Scope(ScopeType.SESSION) to my User.class
            System.out.println(user.getUserName )

            It gives me the value entered in textbox.

            Hope i am clear

            Thanks