9 Replies Latest reply on Jul 7, 2007 4:33 PM by azalea

    Jsf form without entity component

    luuzz

      Hello,
      Is it possible to use a session bean component property to map a jsf form without having to use an entity bean component ?
      I tried it but it doesn't work.

        • 1. Re: Jsf form without entity component
          delphi'sghost

          It is possible.

          Maybe you haven't defined the getters and setters on the interface for the session bean. If you post any error messages or results you get along with any code, that might help.

          Any properties on the session bean are read and written to just like any other property is handled in JSF.



          • 2. Re: Jsf form without entity component
            luuzz

            I'm gonna try this, indeed i didn't put the getters on the interface.
            Yhanks a lot.

            • 3. Re: Jsf form without entity component
              luuzz

              It's working great but i don't understand why i have to expose the setters and getters in the bean interface...
              Thanks

              • 4. Re: Jsf form without entity component
                wschwendt

                 

                "luuzz" wrote:
                It's working great but i don't understand why i have to expose the setters and getters in the bean interface...
                Thanks


                if my understanding is correct, you have to the declare getters and setters in the so-called "business interface" of your EJBs because with the EJB(3) architecture you're never accessing EJB bean instances directly. Technically, when a EJBean is called, a container-generated proxy/stub object is called which in turn delegates to the EJB instance. These container-generated proxy/stub objects implement the same methods as declared in the business interface of your EJB, that's why you need to define a business interface.




                • 5. Re: Jsf form without entity component
                  wschwendt

                  correction, it should read:

                  if my understanding is correct, you have to declare the getters and setters in the so-called "business interface" of your EJBs because with the EJB(3) architecture you're never accessing EJB bean instances directly. Technically, when an EJBean is called, ...

                  • 6. Re: Jsf form without entity component
                    luuzz

                    Ok I understand now.
                    Do you think it's a good idea to do it like this ?
                    Isn't it better to do the form mapping through a pojo component and use bijection in the session bean ?
                    Another question, using stateful session beans, should we still expose the getters and setters in the interface ?

                    • 7. Re: Jsf form without entity component
                      matt.drees

                      Why wouldn't you want to expose getters/setters in the interface?

                      • 8. Re: Jsf form without entity component
                        luuzz

                        usually sesion beans only imlement business methods ....

                        • 9. Re: Jsf form without entity component
                          azalea

                          Now session beans can be backing beans in Seam application,
                          and usually backing beans have getters/setters.