Skip to content

Conversation

@hbina
Copy link

@hbina hbina commented Aug 27, 2018

Fixes the issue where the user enters a string and it will returns error 400 because it can't validate object Greeting of a string id.
Apologies for the duplicate Issues, wonder if I can remove the old one?

@pivotal-issuemaster
Copy link

@hbina Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@hbina Thank you for signing the Contributor License Agreement!

@gregturn
Copy link
Contributor

gregturn commented Nov 16, 2018

This PR contains two changes.

  • It changes the HTML input type from text to number. This is valid in the sense that yes, ids are numbers. And on certain devices, perhaps a smartphone, it would show a numeric input. But this example actually doesn't look since this form really supports editing a database id. A better cleanup would be to NOT show the id, but instead to show something price instead.
  • Alterations to the POJO and how it is passed back and forth to the form. I don't really favor renaming something to GreetingClass. It is ALREADY a class, so why embed that in its name. Also, the template is greeting.html in the folder src/main/resources/templates, hence we know it's a template. So again, no need to embed such semantic information that is already in the context.

The former change I would be open toward collaborating on a clean pull request to apply.

For the latter, I don't think we are going to go with it. If you feel the wording in the guide is lacking, by all means, submit a pull request with proposed changes to clarify how Java beans map onto forms with Thymeleaf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants