Spring MVC model for multiple forms -
I have a model named Model, which is a unit. I use it in many forms, but sometimes I will put some values which are not in my model. For example, I got a field user name, password, email with the model user. Now I want to pass the value of the field that is not in my model, e.g. remember me. I do not know how to solve this, I have 2 options:
a) I have enhanced the model / unit with field recall, annotated as an I @transient, so this is to my DB Does not contain unnecessary information
b) I can make another model class with field memem and use the new model for each page to do this.
I often apply my choice to A). It's easy and fast, but separation of anxiety slightly different.
Option for B. You can create a UserForm class which enhances my property while remembering the user class.
Comments
Post a Comment