Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use JSTL and other Spring tag in javascript file?
    text
    copied!<p>I have two files, first one is <code>list.jsp</code> and other one is <code>loadmore.js</code> I am calling <code>loadmore.js</code> in <code>list.jsp</code> file. I want to use tags like <code>&lt;spring:message code="loadMore" /&gt;</code> and <code>&lt;c:out value="${loadmore}" /&gt;</code> in my JavaScript file. But I don't know how to use or import these libraries in JavaScript file.</p> <p>Can you help how to do this?</p> <hr> <p><strong>Update:</strong> added the following to my configuration:</p> <pre><code>&lt;servlet&gt; &lt;servlet-name&gt;jsp&lt;/servlet-name&gt; &lt;servlet-class&gt;org.apache.jasper.servlet.JspServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;fork&lt;/param-name&gt; &lt;param-value&gt;false&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;xpoweredBy&lt;/param-name&gt; &lt;param-value&gt;false&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;compilerSourceVM&lt;/param-name&gt; &lt;param-value&gt;1.5&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;compilerTargetVM&lt;/param-name&gt; &lt;param-value&gt;1.5&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;3&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;jsp&lt;/servlet-name&gt; &lt;url-pattern&gt;*.js&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>But now I get the following message in my FireBug console.</p> <pre><code>missing ) after argument list console.log("&lt;spring:message code="label.empty" /&gt;"); </code></pre>
 

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