0

I am having trouble getting Pebble template engine to display Java object values in HTML form in a HTTP GET request.

In Pebble template I have a form like this.

<form name="userDetailsForm" action="/update-details" method="post">
    <label>Email Address: </label>
    <input type="text" id="emailAddress" name="emailAddress">
</form>

In Spring MVC I have

@GetMapping("/update-details")
public ModelAndView showUpdateDetails()
{
    UserDetailsForm form = new UserDetailsForm();
    form.setEmailAddress("example@example.com");
    return new ModelAndView("update_details_template", "userDetailsForm", form);
}

When I load the page in browser, the email input field is blank. I would like the email input field to be populated with "example@example.com". How can I achieve this? Is Pebble able to bind Java objects to HTML forms in a HTTP Get request?

0 Answers0