title: How do I append a quote to a string in JSF EL
body: <p>I got a JSF page with a list of partners. </p>
  
  <p>The page is opened in two modes, default and choice mode, that is set with choiceMode request parameter. </p>
  
  <p>When <code>choiceMode</code> parameter is undefined it's just a list where I can click a row and it will navigate to the page with the row's details</p>
  
  <p>If <code>choiceMode="1"</code> it means that the page is opened in an <code>&lt;iframe&gt;</code>, nested in a parent window</p>
  
  <p>When the user clicks a row, it won't open the row's page, but run a JavaScript sending the chosen row parameters to the parent window</p>
  
  <p>The problem is to build up the JavaScript, used when it's the choice mode. In default mode, it must be just <code>""</code>, but in the choice mode it must be something like</p>
  
  <pre><code>rowOnClick(5, "Partner #5")
  </code></pre>
  
  <p>How do I put the double quotes in it? </p>
  
  <p>I can build things like <code>rowOnClick(5, Partner #5)</code> (without quotes) with <code>concat</code> method, but quotes appeared to be a problem. I have tried <code>&amp;quote;</code> and <code>\'</code> and <code>\"</code> and nothing works</p>
  
  <p>The page's code:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"
        xmlns:c="http://java.sun.com/jsp/jstl/core"&gt;
      &lt;h:head&gt;
          &lt;title&gt;Partners&lt;/title&gt;
          &lt;script&gt;
              function cellOnClick(id, name) {
                  parent.document.getElementById("form:parentId").value = id;
                  parent.document.getElementById("form:parentName").value = name;
              }
          &lt;/script&gt;
      &lt;/h:head&gt;
  
      &lt;f:metadata&gt;
          &lt;f:viewParam name="choiceMode" value="#{partnersManagedBean.choiceMode}"/&gt;
      &lt;/f:metadata&gt;
  
      &lt;h:body&gt;
  
          &lt;c:choose&gt;
              &lt;c:when test="#{partnersManagedBean.choiceMode == '1'}"&gt;
                  &lt;c:set var="onclick" value="cellOnClick"/&gt;
              &lt;/c:when&gt;
              &lt;c:otherwise&gt;
                  &lt;c:set var="outcome" value="partner"/&gt;
              &lt;/c:otherwise&gt;
          &lt;/c:choose&gt;
  
          &lt;h:dataTable value="#{partnersManagedBean.partnersList}" var="item"&gt;
              &lt;h:column&gt;
                  &lt;f:facet name="header"&gt;
                      Name
                  &lt;/f:facet&gt;
                  &lt;ez:cell id="name" value="#{item.value.name}" rowId="#{item.value.id}" rowName="#{item.value.name}" outcome="#{outcome}" onclick="#{onclick}"/&gt;
              &lt;/h:column&gt;
          &lt;/h:dataTable&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Composite component:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:cc="http://java.sun.com/jsf/composite"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"&gt;
  
      &lt;cc:interface&gt;
          &lt;cc:attribute name="value" required="true"/&gt;
          &lt;cc:attribute name="rowId" required="true"/&gt;
          &lt;cc:attribute name="rowName" required="true"/&gt;
  
          &lt;cc:attribute name="outcome" default=""/&gt;
          &lt;cc:attribute name="onclick" default=""/&gt;
      &lt;/cc:interface&gt;
  
      &lt;cc:implementation&gt;
          &lt;h:link id="nameLink" 
                  outcome="#{cc.attrs.outcome}" 
                  onclick="#{cc.attrs.onclick==''?'':cc.attrs.onclick.concat('(').concat(cc.attrs.rowId).concat(',&amp;quote;').concat(cc.attrs.rowName).concat('&amp;quote;)')}" 
                  class="cell-link" 
                  style="cursor: pointer"&gt;
              &lt;f:param name="id" value="#{cc.attrs.rowId}"/&gt;
              &lt;div class="cell-div"&gt;
                  #{cc.attrs.value}
              &lt;/div&gt;
          &lt;/h:link&gt;
      &lt;/cc:implementation&gt;
  &lt;/html&gt;
  </code></pre>