Using liferay-ui taglib in Java filesUsing liferay-ui taglib in Java fileshttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1148273312024-03-29T05:53:35Z2024-03-29T05:53:35ZRE: Using liferay-ui taglib in Java filesJan Kadlechttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148290772019-08-21T10:05:05Z2019-08-21T10:05:05Z<html><head></head><body>Solved. <br><br><pre><code>[code]import com.liferay.taglib.ui.UserPortraitTag;
String userPortraitHTML = "";
userPortraitHTML = userPortraitTag.getUserPortraitHTML("userPortraitCssClass",user, themeDisplay);
</code></pre><br>In pom.xml, a dependency needs to be added:<br><br><pre><code></code></pre><pre><code>[code]<dependency>
<groupid>javax.servlet.jsp</groupid>
<artifactid>jsp-api</artifactid>
<version>2.2.1-b03</version>
</dependency></code></pre></body></html>Jan Kadlec2019-08-21T10:05:05ZUsing liferay-ui taglib in Java filesJan Kadlechttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148273302019-08-21T07:16:28Z2019-08-21T07:16:28Z<html><head></head><body>Hi, maybe a weird question, but is it somehow possible to use liferay-ui taglib to generate HTML code in portlet's Java file?<br><br>We have a homepage with list of users' activities and new activities are loaded using AJAX. Each activity has a <pre><code><liferay-ui:user-portrait></liferay-ui:user-portrait></code></pre> in it.But the HTML for ajax loaded activities is generated on request in portlet's main Java file and I can't use liferay-taglib there, because it won't be processed and will be returned as it is. <br>So is there any way how to let Liferay generate the user-por