On Wed, Dec 23, 2009 at 10:54 AM, Krishnakant <[email protected]> wrote:
> On Wed, 2009-12-23 at 09:11 -0800, morellik wrote:
>> Dear all,
>>
>> I'm trying to load an applet java (jMol) but I have some problem to do
>> that because the applet initialization require to specify the relative
>> path of the applet that I'm unable to find.
>>
>> I created the project in amber_tool, so I have the following directory
>> structure:
>> amber_tool/amber_tool/controllers
>> amber_tool/amber_tool/templates
>> The applet is in:
>> amber_tool/amber_tool/public/global/javascript/jmol
>>
>> Under my template I set
>> <script src="/global/javascript/jmol/Jmol.js"></script>
>>
>> but the initialization require a relative path like:
>> jmolInitialize("../../public/global/javascript/jmol");
>>
>> I tried a lot of path without success. Every time I receive "Applet
>> not found".
>> There is a way to set a relative path under Pylons?
>> Thanks
>> Enrico
>
> You will probably have to set the mapping in the routing.py file so that
> it works as you want.
If you can access anything else under public, it's probably not the
mapping but the URL. It's probably too many ".." or not enough ".."
or something like that. One thing is that the public directory itself
should not be in the URL. So if the path is
amber_tool/amber_tool/public/myjs.js, the URL would be "/myjs.js", and
a relative URL would be "../myjs.js" or something like that. If the
current URL is at the top level ("/something"), a relative URL would
simply be "global/javascript/jmol". You could put a "./" (one dot)
before it if you want. You'd use ".." only if the relative location
requires one to go back up the hierarchy and down another branch.
--
Mike Orr <[email protected]>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.