I'm writing a web page using Struts2.
My need is to show a row in a table only when an boolean attribute of an Action class (ie sectionHidden
) is set to false
. To do this, I've written the following code:
<s:if test="sectionHidden"><tr id="sectionTitle" style="display: none;"></s:if>
<s:else><tr id="sectionTitle"></s:else>
<td>This is the section title</td>
</tr>
I think this is not the best way, are there other better ways to do it? (I would like to avoid to write twice the html code related to the tr
)