Hi,
It a good practice to use JSTL for your portlets jsp rather than using scriptlets. This blog will show how to add support of jstl for your portlets. Follow these simple steps -
1. Add portal-dependency jars to lifeary-plugin-package.properties file
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar,\
2. Add portal-dependency tlds to liferay-plugin-package.properties file.
portal-dependency-tlds=\
liferay-portlet_2_0.tld,\
liferay-ui.tld,\
fn.tld,\
c.tld,\
fmt.tld
3. In the JSP add taglibs.
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
4. And now you can use <c:xx />, <fn:xx/> and <fmt:xx> and similarly other taglibs.
Hope this helps.
Until next time. C Ya
It a good practice to use JSTL for your portlets jsp rather than using scriptlets. This blog will show how to add support of jstl for your portlets. Follow these simple steps -
1. Add portal-dependency jars to lifeary-plugin-package.properties file
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar,\
2. Add portal-dependency tlds to liferay-plugin-package.properties file.
portal-dependency-tlds=\
liferay-portlet_2_0.tld,\
liferay-ui.tld,\
fn.tld,\
c.tld,\
fmt.tld
3. In the JSP add taglibs.
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
4. And now you can use <c:xx />, <fn:xx/> and <fmt:xx> and similarly other taglibs.
Hope this helps.
Until next time. C Ya
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.