1

I have a java web app running in spring web flow framework and hibernate as ORM. I wanna ask what the best practice is with regards to binding the form values. Do I create a pojo or bean representing each form so that I have an object where I can bind the form to? I can try getting the values as parameters in the url but I don't think this is a good approach.

What I was trying to do is pass the values inputted from the forms to the flow xml and use the values there as parameters in calling functions.

  <view-state id="editForm" model="registerBean" view="../xhtml/framework/edit">        
    <transition on="editButton" to="dummy" >
        <set name="flowScope.newPassword" value="requestParameters.newPassword"/>
        <set name="flowScope.confirmPassword" value="requestParameters.confirmPassword"/>
    </transition>
    <transition on="delete" to="deleteEmployee" />
    <transition on="back" to="loginSuccessful" />
</view-state>

I printed ${newPassword} in an xhtml file but get no output. So I was thinking of having an object representing the form and bind the values and access them in my flow xml

1 Answer 1

2

Use <form:bind> directly with your domain (Hibernate) objects, no need of extra objects just for the sake if populating with data. If you have one domain object per screen, you can use spring's SimpleFormController.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.