You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2008/08/26 15:05:44 UTC

[jira] Resolved: (SLING-615) Some jst's do not work on Mac

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

Bertrand Delacretaz resolved SLING-615.
---------------------------------------

    Resolution: Fixed

Fixed in revision 689056, the servlet that generates the client-side javascript uses regular expressions to find the <body> in the jst scripts, and those expressions were wrong.

The problem was visible by looking at the generated js code, for example http://localhost:8888/apps/tss/post.jst.jst.js (which is generated from /apps/tss/post.jst) contained just "out=document;", indicating that the code generator didn't find a <body> tag.

I have no idea why this could work on some platforms, as the code was clearly broken ;-)

This simplistic parsing could be problematic, for example including <body> in an html comment before the actual body breaks it.

Please cross-check and close this issue if ok.

> Some jst's do not work on Mac
> -----------------------------
>
>                 Key: SLING-615
>                 URL: https://issues.apache.org/jira/browse/SLING-615
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>            Reporter: Felix Meschberger
>            Assignee: Bertrand Delacretaz
>         Attachments: tss.zip
>
>
> Michael Marth reported on some JSTs not working on Mac OS X:
> "I saw this problem during a presales training, but thought it is with a
> particular machine only. Now Kathy has sent the mail below where the problem
> with jst's on Macs is described in detail.
> The problem does not occur on Windows
> --
> For some reason, on the mac, Phil and I have had to name some of the files that
> you use as jst to esp. (Bertrand suggested this solution while we were in for
> training.) The two problem files are post.jst/esp and html.jst/esp.  Naming
> these two files with the .jst extension just returns an empty page.   (None of
> our XP buddies are having this problem, only us mac users.) For some reason,
> admin.jst works just fine...    (and, yes, I am moving the files up to the tss
> directory as described in the errata)
> Once renamed, post.esp also works just fine. 
> However, html.esp is throwing a '"Sling" is not defined' error for the following
> statement:
> posts=Sling.getContent("/content/tss/posts", 2);
> I saw in a PDF file on the wiki that I might have to include sling.js as a
> script in the file.  And the notes say that I also have to sling-551.js.  So I
> included both files in the following fashion, as suggested by the Non CMS Web
> App.pdf document:
> <script src="/system/sling.js"></script>
> <script src="/system/sling-551.js"></script>
> (and yes, both of those files are in /system)
> However, it is throwing the same error.  So I have two questions:
> 1) Why is jst working only intermittently on the mac?
> 2) If we have to rename the files to esp, how can I get html.esp to recognize
> the sling library? Do I have to put sling.js in a different place?"
> I do not have an assessment for this issue. Maybe someone else here ?
> In addition, I also asked for the sample files and logs etc.

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