Which directory to give for a file loaded by a JAR application?
fdelente - December 24, 2008 - 14:10
Hello.
I've just installed and configured drupal-6.8, using it with xampp-1.7, and I started to create content for my pages.
I'd like to embed a java application that is in a JAR. To do that, I need to include this type of code:
<applet code="geogebra.GeoGebraApplet" codebase="./" archive="http://www.geogebra.at/webstart/dev/geogebra.jar" width="300" height="300">
<param name="filename" value="exemple_geogebra_2.ggb">
<param name="framePossible" value="false">
</applet>The "exemple_geogebra_2.ggb" is a file created by the stand-alone application, while the JAR is a subset of this application for rendering only (not for the creation of ggb files).
However, it doesn't work, as the JAR loads ok, but doesn't find the ggb file. Where should I put it? Presently it's at http://localhost/exemple_geogebra_2.ggb, but the "value" parameter must be a local file name, not an URL.
Thanks.

Did you try a relative url?
Did you try a relative url? One that is relative to the page calling it. It might be
exemple_geogebra_2.ggb
or ../exemple_geogebra_2.ggb,
or ../google/exemple_geogebra_2.ggb,
or google/exemple_geogebra_2.ggb,
Which directory to give for a file...
No, I'll give it a try; but as my pages' URL are generally of the form /?q=node/3, I don't really know if a relative URL might work.
In fact I don't really know where the page that I'm currently viewing on my site is, as there is no 'node' directory in the root of the site.
I'll experiment, though...
1. "local" only has meaning
1. "local" only has meaning when u are playing with your PC. When u upload your system to an Internet server, what's "local" means?
if u MUST use a local file name .. i dont know the answer.
if u MAY use a url, u may put your JAR and data file in your module folder. i.e. sites/all/modules/yourModule, the full URL of the data file will be
$url = $base_url . '/' . drupal_get_path('module','yourModule') . '/filename';
Which directory to give for a file...
> if u MUST use a local file name
It seems it's part of my problem: I tried giving an absolute URL ("http://mysite.org/Docs/exemple_geogebra_1.ggb") and it didn't work, so I'm quite sure that I must give a file name, relative or absolute, but not an URL.
Furthermore I don't want to program in PHP as I don't even know where I should put this PHP so that it is executed when the page is loaded. Can I put it directly in the page itself?
java sand box issue?
java sand box issue?