views:

237

answers:

1

I am writing a small widget in struts which I want to include. The height of the widget should be auto unless I pass in a param of height. For example:

# Example 1:
<s:include value="myWidget.jsp">
  <s:param name="height">300 px</s:param>
</s:include>

# Example 2:
<s:include value="myWidget.jsp">
</s:include>

Inside myWidget.jsp I can access the value of height using ${param.height}. But if I don't pass the height param it simple comes across as blank. I want to set the value explicitly to "auto", how can I do this?

A: 

You could use c:out in the JSTL core tags.

<c:out value="${param.height}" default="auto"/>
Adam B