Error in my taglib <%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>

Wael picture Wael · Dec 21, 2012 · Viewed 13.2k times · Source

When I developed my portlet and when i wrote my jsp page I used:

<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>

but eclipse show me an error telling me that it cannot find the tag lib descriptor for http://java.sun.com/portlet_2_0.

How can I resolve this issue wihtout using tld files ?

Answer

Linh Lino picture Linh Lino · Jan 9, 2013

In my case, I am using Liferay Portal, so in order to avoid this error I changed:

<%@ taglib uri="http://java.sun.com/portlet_2_0"% prefix="portlet">


to

<%@ taglib uri="/WEB-INF/tld/liferay-portlet.tld" prefix="portlet" %>


and in file "WEB-INF/liferay-plugin-package.properties"; I added this line

portal-dependency-tlds=/WEB-INF/tld/liferay-portlet.tld

which is suggested by a Liferay staff (Link)