alernative to <bean:write> in JSTL

Hi All,

I have a struts form bean - comForm and it has a property comArticle - which is a List of objects(bean objects).

again each bean object has some more properties e.g articleSummary.

I am using JSTL to print the articleSummary.

<c:forEach items="${comForm.comArticle}" var="article" >

<c:out value="${article.articleSummary}"/>

</c:forEach>

But my problem is have HTML tags inside, which are not getting reflected.

I also used bean:write with filter="true" like this:

<logic:present name="comForm" >

<bean:write filter="true" name="comForm" property="comArticle"/>

</logic:present>

output: ComArticle@7b30f686

I even tried this:

<logic:present name="comForm" >

<logic:present name="comArticle" >

<bean:write filter="false" name="comArticle" property="articleSummary"/>

</logic:present>

</logic:present>

output: blank :)

[988 byte] By [pingu143a] at [2007-11-27 11:27:21]
# 1

check out this one:

http://forum.java.sun.com/thread.jspa?threadID=639376&messageID=3749081

skp71a at 2007-7-29 16:15:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Try:

<c:out value="${article.articleSummary}" escapeXml="false"/>

or

<bean:write name="article" property="articleSummary" filter="false"/>

evnafetsa at 2007-7-29 16:15:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hi All,

Thanks a lot for your replies.

JSTL escapeXml="false" worked.

But I still have a problem:

with the articleSummary, which is a byte[].(BLOB in DB)

I converted the byte[] to String by setting a property as:

public void setArticleSummary(byte[] bs) {

articleSummary = bs;

setStrArticleSummary(articleSummary);// converts byte[] to String

}

}

<c:out escapeXml="false" value="${article.strArticleSummary}"/>

I think there should be a cleaner way to do it in JSTL.

Message was edited by:

pingu143

Message was edited by:

pingu143

pingu143a at 2007-7-29 16:15:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...