title: How to print a java String in a jsp file
body: <p>I'm trying to print a string variable via my jsp file, here is my code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java"%&gt;
  &lt;%@ page import="java.sql.*"%&gt;
  &lt;%@ page import="java.lang.*;"%&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;why are you not working&lt;/title&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;%
          String test = "&lt;b&gt;&lt;u&gt;bold and underlined&lt;/u&gt;&lt;/b&gt;";
       %&gt;
  
      &lt;c:set var="test1" value="&lt;u&gt;underlined&lt;/u&gt;" /&gt;
      &lt;c:set var="test2" value="${test}" /&gt;
  
      &lt;c:out value="${test}" escapeXml="false" /&gt;
      &lt;c:out value="${test1}" escapeXml="false" /&gt;
      &lt;c:out value="${test2}" escapeXml="false" /&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>output:</p>
  
  <p><a href="https://i.stack.imgur.com/0e44K.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0e44K.png" alt="enter image description here"></a></p>
  
  <p>Is there a way to print <em>test</em> or <em>test2</em> using JSTL ? As you can see in the code above I've managed to print the variable test1 but nothing appear on the page for the variables test or test2.</p>
  
  <p>PS: why I want to use JSTL ? Because it offers a way to evaluate html tags and not escape them</p>