Thymeleaf attributes with no html element

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Thymeleaf attributes with no html element

Federico
What I do is use the Thymeleaf attributes but I don't want to have for example an extra div.

For example, I have this

    <div sec:authorize="hasRole('ROLE_ADMIN')">
        This content is only shown to administrators.
    </div>

But I'd like something like this:

    <sec:authorize="hasRole('ROLE_ADMIN')">
        This content is only shown to administrators.
    </>

Is this possible?
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf attributes with no html element

niels
You can use th:remove to remove the div tag in the generated html. I hope this helps.
Niels
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf attributes with no html element

Federico
Thanks niels I used th:remove="tag" that did exactly what I was looking for. Thank you very much.