Thymeleaf+Spring+Liferay

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

Thymeleaf+Spring+Liferay

airmarcos
Hi All,
I'm new to the forum and I've been playin around with the great Thymeleaf tool with web apps.

I now would like to bring thymeleaf on a portlet container as Liferay. The issue here is that i'm not able to do something like this
<portlet:renderURL var="userUrl">
<portlet:param name="myaction" value="editUserForm" />
</portlet:renderURL>
        <a href="${userUrl}">user


because of course it is not standard HTML.

The problem is that with thymeleaf on a portlet container i'm not able to generate at runtime the (complex) complete portlet url of the page i would like to invoke.

Is there an elegant way to generate the portlet URL with thymeleaf?
Really appreciated any help.
Regards
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf+Spring+Liferay

Zemi
Administrator
Hi,

I'm afraid there are no Lireray+Thymeleaf users around here...

As
   <portlet:renderURL>
is a JSP tag, you'll have to implement an AttributeProcessor with the same logic as the JSP tag.

Coding an AttributeProcessor is not difficult and it is described in the "Extending Thymeleaf" tutorial at the Thymeleaf documentation.

You should look up the JSP tag source code and translate it to a Thymeleaf processor, to finally use somewhat similar to the following code:
   < a portlet:url="myaction='editUserForm'" >user...

Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf+Spring+Liferay

airmarcos
Hi Zemi,
really thanks for the reply. I will try your suggestion and let you know.
Regards
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf+Spring+Liferay

sachin goyal
Please let us know if this approach worked. Can you share your Thymeleaf HTML and Controller file if it worked