<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/calling-an-object-s-method-from-thymeleaf-vksmbvbzd" -->

---
title: Calling an Object’s Method From Thymeleaf | daily.dev
description: Thymeleaf templates can call Java methods in several ways: accessing model object methods using getter syntax or direct method invocation with parameters,...
canonical: https://daily.dev/posts/calling-an-object-s-method-from-thymeleaf-vksmbvbzd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Calling an Object’s Method From Thymeleaf | daily.dev
og:description: Thymeleaf templates can call Java methods in several ways: accessing model object methods using getter syntax or direct method invocation with parameters,...
og:url: https://daily.dev/posts/calling-an-object-s-method-from-thymeleaf-vksmbvbzd
og:image: https://api.daily.dev/og/posts/VKsMbVbZd.png
og:image:alt: Calling an Object’s Method From Thymeleaf
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Calling an Object’s Method From Thymeleaf

**[Baeldung](https://daily.dev/sources/baeldung)** · 5 min read · 3 upvotes · 0 comments

## Summary

Thymeleaf templates can call Java methods in several ways: accessing model object methods using getter syntax or direct method invocation with parameters, calling static methods on classes using SpEL's T() operator, and invoking methods on Spring beans using the @ prefix with the bean name. Model object methods are the most common use case, while static methods help with formatting values, and Spring beans provide reusable functionality across templates without manual injection into controllers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://feeds.feedblitz.com/~/944071964/0/baeldung~Calling-an-Object%E2%80%99s-Method-From-Thymeleaf>

## Similar posts on daily.dev

- [Writing a Thymeleaf component library - part 2](https://daily.dev/posts/writing-a-thymeleaf-component-library---part-2-ibhbku0a4) · Wim Deblauwe · 1 upvotes · 0 comments
- [Templating in Java Using JTE](https://daily.dev/posts/templating-in-java-using-jte-xdgkherzt) · Baeldung · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#spring](https://daily.dev/tags/spring)

[View this post on daily.dev](https://daily.dev/posts/calling-an-object-s-method-from-thymeleaf-vksmbvbzd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Calling an Object’s Method From Thymeleaf","url":"https://daily.dev/posts/calling-an-object-s-method-from-thymeleaf-vksmbvbzd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/calling-an-object-s-method-from-thymeleaf-vksmbvbzd"},"datePublished":"2026-02-01T15:32:03.585Z","dateModified":"2026-02-01T15:35:12.904Z","description":"Thymeleaf templates can call Java methods in several ways: accessing model object methods using getter syntax or direct method invocation with parameters,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/dc58ea669b65b9d90ead4b7d1899d64a?_a=AQAEulh","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/dc58ea669b65b9d90ead4b7d1899d64a?_a=AQAEulh","isAccessibleForFree":true,"articleSection":"Baeldung","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Baeldung","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576","url":"https://daily.dev/sources/baeldung"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/calling-an-object-s-method-from-thymeleaf-vksmbvbzd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,spring","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Baeldung","item":"https://daily.dev/sources/baeldung"},{"@type":"ListItem","position":3,"name":"Calling an Object’s Method From Thymeleaf"}]}
```

