0

I want to display some Javascript code using <%=%> tag in a jsp page . but whenever I tried it jsp find it as its tag . How to resolve that ? I have a code block like this :

<script id="travel-template" type="text/html">
    <div style="border: 1px solid #000000;">
        <h4><%= name %></h4>
        <div class="outline">
            <a href="<%= link %>"><%= link_text %></a><br />
            Cat: <%= category %><br />
            Type: <%= type %>
        </div>
    </div>
</script>

Here name, link, link_text will get value from javascript . but when I use that codeblock in jsp , this <%= %> consider name , link as an jsp variable and get an error.

Titli4fly
  • 11
  • 2

0 Answers0