Rajan
Rajan

Reputation: 1511

What would be the best mapping between html inputs and java types inside a class

I am not an expert in html + java. I was trying to design a user form to collect data and then to bind it to a Java class using spring. I am using html inputs like

Now, for text input, the corresponding Java type will be String. What would be the best Types or collections for other html inputs or vice-versa.

Upvotes: 1

Views: 76

Answers (1)

Albert Pinto
Albert Pinto

Reputation: 402

it all depends on what you will be doing with the data. As you said for text input you are using string. For radio boxes you can use Boolean. For check box you can choose a string or an enum.

Upvotes: 1

Related Questions