title: Default value on JSP custom-tag attribute
body: <p>When defining an attribute for a custom JSP tag, is it possible to specify a default value? The <code>attribute</code> directive doesn't have a default value attribute. Currently I'm making do with:</p>
  
  <pre><code>&lt;%@ attribute name="myAttr" required="false" type="java.lang.String" %&gt;
  
  &lt;c:if test="${empty myAttr}" &gt;
   &lt;c:set var="myAttr" value="defaultValue" /&gt;
  &lt;/c:if&gt;
  </code></pre>
  
  <p>Is there a better way?</p>