public class UserBackingBean extends BaseObject {


    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }


Registration.jsp:


                <TR>
                    <TD>
                        <h:outputText value="#{messages['label.firstName']}" />:
                    </TD>
                    <TD>
                        <h:inputText value="#{UserBackingBean.user.firstName}"
                                     required="true"
                                     id="firstName" >
                            <f:validateLength minimum="2" />
                        </h:inputText>
                        <h:message for="">                                   errorClass="error" />
                    </TD>
                </TR>





On 11/3/06, Mick Knutson < [EMAIL PROTECTED]> wrote:
Then can you please show me an exapmle of your jsp and you BackingBean and DAO?
I have tried what you said, but can't seem to get it to work.







On 11/3/06, Jeff Bischoff <[EMAIL PROTECTED]> wrote:
Mick,

I don't know specifically about hibernate.

However, I get the gist of your issue, and have faced the same question
myself. I think the general pattern for this is to have a DAO (Data
Access Object) as a member variable (property) of the managed bean. That
way the managed bean simply contains-a, instead of is-a.

Definately don't copy/paste every getter and setter into a managed bean.
To do so would unnecessarily complicate your code and couple your layers. :)

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Mick Knutson wrote:
> I have an existing Hibernate project with many hibernate mapped POJO's.
>
> I do not want to add all the set/get methods from my POJO into Backing
> Beans, so I am wondering what others have done?
>
> Have your BackingBean extend you hibernate object?
>








--

Thanks

DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson

Reply via email to