Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

thymeleaf Expression Object dialects

public class MyDialect extends AbstractDialect implements IExpressionEnhancingDialect {

  public MyDialect() {
    super();
  }

  @Override
  public String getPrefix() {
    // @see org.thymeleaf.dialect.IDialect#getPrefix
    return "xxx";
  }

  @Override
  public boolean isLenient() {
    return false;
  }

  @Override
  public Map<String, Object> getAdditionalExpressionObjects(IProcessingContext ctx) {
    Map<String, Object> expressions = new HashMap<>();
    expressions.put("labels", new LabelUtil());
    return expressions;
  }
}
@Configuration
public class ThymeleafConfig {

  @Bean
  public MyDialect myDialect() {
    return new MyDialect();
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #thymeleaf #Expression #Object #dialects
ADD COMMENT
Topic
Name
2+3 =