Access an attribute of a HashMap for a .ftl view with Java

0

I'm trying to access an attribute of a Java object but I can not get it. I have the controller where I create the object and add the data:

    Email emailModel = new Email();

    buildMailModel(emailModel);

    Map<String, Object> root = new HashMap<>();
    root.put("EmailModel", emailModel);

    private static void buildMailModel(Email emailModel) {

        List<ComponentBase> components = getComponents();

        emailModel.setComponents(components);

        emailModel.setDocument(getNewsDocument());

        emailModel.setDestinataries(getDestinataries());

        emailModel.setShippingConfiguration(getShippingConfiguration());

    }

This creates the object with this structure:

Then I try to access the attribute title in the .ftl in the following way, but I do not get it:

${emailModel.document.title}
    
asked by charli 31.10.2018 в 14:32
source

0 answers