1

以下の Struts 2 タグがあります。プロパティvalue="#attr.row.Commentaireが空でないかどうかを確認する必要があります。そうでない場合は、ユーザーがクリックしてプロパティの内容を参照できる小さなアイコンを表示しますvalue="#attr.row.Commentaire

<s:if>Struts 2のタグを効率的に使用するにはどうすればよいですか?

<display:column title="Commentaire" sortable="true" sortProperty="Commentaire"
    class="alerte_td_commentaire">              
<s:property value="#attr.row.Commentaire"/>
4

1 に答える 1

0

次のコードを使用します

<s:if test="#attr.row.Commentaire != null && #attr.row.Commentaire != ''">

ifタグtest属性を使用して、OGNL 式をブール値に評価します

タグと組み合わせて使用​​できる HTML アンカー タグをレンダリングするaタグifを使用して、

物件の内容を相談する

debug他のタグをラップして、デバッグ データをレンダリングするリンクを表示するために使用できるタグもあります。

<s:debug>  
 <s:property value="%{#attr.row.Commentaire}"/>
</s:debug>
于 2013-07-30T10:33:33.460 に答える