Note that there are some explanatory texts on larger screens.

plurals
  1. POjsp:text losing whitespace inside tagx
    text
    copied!<p>Trying to use JSPX and running into a strange problem. Text inside jsp:text is supposed to not be subject to whitespace removal, according to the JSP documentation, but when I have a jsp:text element with leading whitespace in the beginning of a tagx file, when used in the jspx views, the leading whitespace disappears.</p> <p>I've done quite a bit of Googling but can't find what's causing this to be removed. I've verified that the same jsp:text instances included directly in the jspx view work correctly, but put into a separate tagx file causes it to be lost.</p> <p>This is under Jetty 6.1.19 and 6.1.22 using JSP 2.1 libraries.</p> <p><strong>EDIT</strong>: Some sample code follows. Note that the spaces leading and trailing within the <code>&lt;jsp:text&gt;</code> tags are stripped. Judging by the JSP documentation I can see, whitespace within those should be retained.</p> <p>WEB-INF/tabs/nameValuePair.tagx:</p> <pre><code>&lt;jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"&gt; &lt;jsp:directive.attribute name="name" type="java.lang.String" required="true"/&gt; &lt;jsp:directive.attribute name="value" type="java.lang.String" required="true"/&gt; &lt;jsp:text&gt; ${name}=${value} &lt;/jsp:text&gt; &lt;/jsp:root&gt; </code></pre> <p>test.jspx:</p> <pre><code>&lt;jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:t="urn:jsptagdir:/WEB-INF/tags"&gt; &lt;jsp:directive.page contentType="text/html; charset=ISO-8859-1" /&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Test&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;t:nameValuePair name="name" value="Google" /&gt; &lt;t:nameValuePair name="age" value="11" /&gt; &lt;t:nameValuePair name="description" value="Popular Search Engine" /&gt; &lt;jsp:text&gt; test=value &lt;/jsp:text&gt; &lt;/body&gt; &lt;/html&gt; &lt;/jsp:root&gt; </code></pre> <p>output:</p> <pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;name=Googleage=11description=Popular Search Engine test=value &lt;/body&gt;&lt;/html&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