Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery tmpl and JSP code not playing nicely
    primarykey
    data
    text
    <p>I've been using the <a href="http://api.jquery.com/jquery.tmpl/" rel="noreferrer">jQuery tmpl</a> library for some projects and really liking it.</p> <p>I'm not using it on a small project that needs to be in JSP, and things got strange. It is not working fully.</p> <pre><code>&lt;script id="servicesRow" type="text/x-jquery-tmpl"&gt; &lt;tr id="id_${id}"&gt; &lt;td&gt;${name2}&lt;br /&gt;${id}&lt;/td&gt; &lt;td&gt;${supported_roles}&lt;/td&gt; &lt;td&gt;&lt;button class="edit"&gt;Edit&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;button class="delete"&gt;Delete&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="#"&gt;Show clients&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/script&gt; </code></pre> <p>I was trying to understand why no data was showing up. Turns out some kind of parsing is happening of text in the page that looks like <code>${foo}</code>. So when I view source on my page all those elements have been replaced, like this:</p> <pre><code>&lt;script id="servicesRow" type="text/x-jquery-tmpl"&gt; &lt;tr id="id_"&gt; &lt;td&gt;&lt;br /&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;button class="edit"&gt;Edit&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;button class="delete"&gt;Delete&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="#"&gt;Show clients&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/script&gt; </code></pre> <p>Which is still usable as a template, but then jQuery tmpl can't do its job. I get lots of empty rows.</p> <p>The syntax matches some documentation I've found for JSTL. But I've not, that I can tell, installed that. I'm developing on stock, current Tomcat on Windows 7 and building up an app in my webapps/ folder from scratch. I've not, that I can tell, enabled anything like this, and I'm surprised that bare <code>${}</code> is getting parsed (as opposed to things more like <code>&lt;%= %&gt;</code>, which would be more common as from PHP or ASP and similar.</p> <p>So my question: how do I turn off this parsing behavior for my jQuery tmpl templates? Globally, locally to the individual JSP, or escape it (I've tried extra braces, I've tried backslashes, I've tried various quotes). I think Ideally there would be something like:</p> <pre><code>&lt;foo:stopParsingMyDollarSignsAndBracesPlease&gt; &lt;script id="servicesRow" type="text/x-jquery-tmpl"&gt; &lt;tr id="id_${id}"&gt; &lt;td&gt;${name2}&lt;br /&gt;${id}&lt;/td&gt; &lt;td&gt;${supported_roles}&lt;/td&gt; &lt;td&gt;&lt;button class="edit"&gt;Edit&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;button class="delete"&gt;Delete&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="#"&gt;Show clients&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/script&gt; &lt;/foo:stopParsingMyDollarSignsAndBracesPlease&gt; </code></pre> <p>Any help or ideas are appreciated. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload