You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2007/10/19 15:29:50 UTC

[jira] Assigned: (SLING-69) ESPReader fails to parse some ESPs

     [ https://issues.apache.org/jira/browse/SLING-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned SLING-69:
--------------------------------------

    Assignee: Felix Meschberger

> ESPReader fails to parse some ESPs
> ----------------------------------
>
>                 Key: SLING-69
>                 URL: https://issues.apache.org/jira/browse/SLING-69
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Lars Trieloff
>            Assignee: Felix Meschberger
>
> The ESPReader is unable to pre-process following ESP snippet:
> <%-- microsling ESP template example, store this as html.esp --%>
> <html>
> <body>
> <p>This page is generated from an ESP template!</p>
> <h1>Edit <%= resource.getURI() %></h1>
> <form method="POST" action="/microsling<%= resource.getURI() %>.sling">
> <% 
> var it = resource.item.properties;
> while(it.hasNext()) {
> var p = it.next();
> %>
> <%
> if (p.name=="jcr:primaryType") {
> continue;
> }
> %>
> <p>
> <%= p.name %>
> <input type="text" name="<%= p.name %>" value="<%= p.string %>"/>
> </p>
> <%
> }
> %>
> <input type="submit">
> </form>
> <form method="POST" action="/microsling<%= resource.getURI() %>.edit.html">
> Downcase!
> <input type="submit">
> </form>
> </body>
> </html>
> The Javascript generated by the reader is as follows:
> out.write("\n");
> out.write("<html>\n");
> out.write("<body>\n");
> out.write("<p>This page is generated from an ESP template!</p>\n");
> out.write("<h1>Edit ");out.write( resource.getURI() );out.write("</h1>\n");
> out.write("\n");
> out.write("<form method=\"POST\" action=\"/microsling");out.write( resource.getURI() );out.write(".sling\">\n");
>  
> var it = resource.item.properties;
> while(it.hasNext()) {
> var p = it.next();
> out.write("\n");
> if (p.name=="jcr:primaryType") {
> continue;
> }
> out.write("\n");
> out.write("<p>\n");
> out.write( p.name );out.write("\n");
> out.write("<input type=\"text\" name=\"");out.write( p.name );out.write("\" value=\"");out.write( p.string );out.write("\"/>\n");
> out.write("</p>\n");
> }
> out.write("\n");
> out.write("<input type=\"submit\">\n");
> out.write("</form>\n");
> out.write("\n");
> out.write("\n");
> out.write("<form method=\"POST\" action=\"/microsling");out.write( resource.getURI() );out.write(".edit.html\">\n");
> out.write("Downcase!\n");
> out.write("<input type=\"submit\">\n");
> out.write("</form>\n");
> out.write("\n");
> out.write("</body>\n");
> out.write("</html>\n");
> This leads to an parser exception in Rhino, 
> unterminated string literal (/sling/scripts/microsling/example/edit/html.esp#31)
> org.mozilla.javascript.EvaluatorException: unterminated string literal (/sling/scripts/microsling/example/edit/html.esp#31)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.