Fórumok

Liferay portlet and custom taglib

Ludovic Dussart, módosítva 11 év-val korábban

Liferay portlet and custom taglib

New Member Bejegyzések: 8 Csatlakozás dátuma: 2013.02.25. Legújabb bejegyzések
Hi,

I try to create customs taglibs for my liferay portlet. My tag is called successfully but my EL expressions aren't interpreted.
See my code below to understand :

My .tag file :

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ tag body-content="scriptless"  %>
<%@ attribute name="id"  required="false"  type="java.lang.String" %>
<%@ attribute name="className"  required="false"  type="java.lang.String" %>
<%@ attribute name="classNameMiddle"  required="false"  type="java.lang.String" %>
<%@ attribute name="taille"  required="false"  type="java.lang.String" %>

<c:set var="classeBloc">bloc01</c:set>
<c:if test="${not empty taille}">
	<c:set var="classeBloc">bloc01_${taille}</c:set>
</c:if>
<c:if test="${empty taille}">
empty
</c:if>

<div class="${classeBloc} <%=className%>" id="${id}">
	<div class="top">
	</div>
    <div class="${classNameMiddle} middle">
		<jsp:dobody />
	</div>                       
    <div class="footer"></div>
</div>


My jsp call :


&lt;%@ taglib prefix="erc" uri="/taglib/erc"%&gt;


<erc:block01 classname="test" id="toto">
	testn
</erc:block01>


Here is the htlm code generated :


<div class="${classeBloc} test" id="${id}"> 
     <div class="top"> </div> 
     <div class="${classNameMiddle} middle" id="aui_3_4_0_1_521"> 
             testn 
     </div> 
     <div class="footer"></div> 
</div>


The EL corresponding to the taglib attributes are not replaced by the taglig attributes values (like in a jsp file ...)
Only the scriplet is evaluated (<%=className%>" => test)

Guys, any ideas ?

Thank you in advance
Ludovic Dussart, módosítva 11 év-val korábban

RE: Liferay portlet and custom taglib

New Member Bejegyzések: 8 Csatlakozás dátuma: 2013.02.25. Legújabb bejegyzések
Nobody to help me ?