title: Migration JSF 1.2 to JSF 2 <c:set> var set with null or empty value
body: <p>I'm getting a</p>
  
  <pre><code>10:55:06,770 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/Lisa].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: javax.faces.view.facelets.TagException: //somewhere/mytag.xhtml @22,37 &lt;c:set&gt; var set with null or empty value
  at com.sun.faces.facelets.tag.jstl.core.SetHandler.apply(SetHandler.java:118) [:2.0.3-]
  at com.sun.faces.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:93) [:2.0.3-]
  at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:94) [:2.0.3-]
  at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:162) [:2.0.3-]
  at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:89) [:2.0.3-]
  at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:79) [:2.0.3-]
  </code></pre>
  
  <p>What is the desired workaround? I'm trying to avoid jstl functions, but c:set is unavoidable it seems.</p>
  
  <p>In the tag I'm basically using</p>
  
  <pre><code>    &lt;c:set var="longLabel" value="#{labelBundle[longLabelKey]}" /&gt;
  &lt;c:if test="#{hv:startsWith(longLabel, '???')}"&gt;
      &lt;c:set var="longLabel" value="" /&gt;
  &lt;/c:if&gt;
  </code></pre>
  
  <p>the problem is a general one: say I have 
  <code>&lt;c:set var="x" value="#{bean.value}"/&gt;</code> where bean.value can be null or empty string. What now?</p>
  
  <p>I <a href="http://balusc.blogspot.ch/2011/09/communication-in-jsf-20.html#ViewScopedFailsInTagHandlers" rel="nofollow">read</a> about replacing ui:param with c:set - i'll try out this one</p>