Hi All...
Making Tabs in Liferay is Easy. We can get it with few codes.
I'm giving an example of tabs in a struts portlet.
1. Write the following code in the jsp of portlet, you wish to make tabs. I'm making it in view.jsp
<%
String tabNames = "About,Site Map,Contact Us";
String tabs1 = ParamUtil.getString(request, "tabs1", "About");
PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("struts_action", "/ext/portlet/tabs/view");
portletURL.setParameter("tabs1", tabs1);
%>
<liferay-ui:tabs names="<%= tabNames %>" url="<%= portletURL.toString() %>"/>
<c:if test='<%= tabs1.equals("About") %>'>
<liferay-util:include page="/html/portlet/ext/tabs/about.jsp" />
</c:if>
<c:if test='<%= tabs1.equals("Site Map") %>'>
<liferay-util:include page="/html/portlet/ext/tabs/siteMap.jsp" />
</c:if>
<c:if test='<%= tabs1.equals("Contact Us") %>'>
<liferay-util:include page="/html/portlet/ext/tabs/contactUs.jsp" />
</c:if>
2. Now make three jsp files with the names 'about.jsp', 'siteMap.jsp' and 'contactUs.jsp'. These are the jsp files that get included in case of the respective tabs.
3. Make the following entry in struts-config.xml
<action path="/ext/portlet/tabs/view" forward="ext.portlet.tabs.view" />
4. finally, add following in tiles-defs.xml
<definition name="ext.portlet.tabs.view" extends="portlet">
<put name="portlet_content" value="/portlet/ext/tabs/view.jsp" />
</definition>
This is all for making tabs in portlet. Hope this will help.