title: How can I escape both quotation mark and backslash in jsp?
body: <p>I need to escape " and \ in jsp, but not necessarily in the same time.</p>
  
  <p>With <code>&lt;c:out var="${value}" /&gt;</code> I can escape <code>"</code> character.</p>
  
  <p>With <code>${fn:replace(value,'\\','&amp;#92;')}</code> I can escape the <code>\</code> character, and is working fine.</p>
  
  <p>I tried to handle both cases as follows. </p>
  
  <p>I tried to use </p>
  
  <pre><code>&lt;c:out var="${fn:replace(value,'\\','&amp;#92;')}"/&gt;
  </code></pre>
  
  <p>but is not working, is not accepted, seems to be an error.</p>
  
  <p>I also tried to put in a <code>variable</code> the string after replace, and after that using it in <code>c:out</code>, but was the same thing.</p>
  
  <p>If anyone has an idea of a way to handle both cases, please let me know.</p>
  
  <p>Note: the input comes from <code>Java</code>, that's why I used <code>\\</code>, and is sent forward as <code>JSON</code>.
  Thanks </p>