Page 1 of 1

Class mapping

Posted: Fri Jul 05, 2013 5:29 am
by hura
Hi,

Could you explain me how do you map your class and field into htm file. I could not find the place you define your class,you entity.
For ex:in the register.htm file:

Code: Select all

 
<div class="form50">
                <label for="customer.emailAddress"><span th:text="#{register.email}">Email</span></label>
                <span class="error" th:if="${#fields.hasErrors('customer.emailAddress')}" th:errors="*{customer.emailAddress}">    </span>
                <input type="email" th:field="*{customer.emailAddress}" class="field50" th:classappend="${#fields.hasErrors('customer.emailAddress')}? 'fieldError'" />
            </div>

Could you show me what are "#{register.email}" & 'customer.emailAddress, where can I find the "register" and "customer" objects?

Thank you!

Re: Class mapping

Posted: Fri Jul 05, 2013 6:52 pm
by bpolster
The values get set using Spring-MVC.

Start by looking at RegisterController in the demo site. You'll see that this delegates the method calls to BroadleafRegisterController which is part of the framework.

The Controller sets up the RegisterCustomerForm.