Historical:Have a single ptviewer jar file per website

From PanoTools.org Wiki
Revision as of 15:07, 24 August 2005 by Bruno (talk | contribs) (some stuff on mod_rewrite)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

PTViewer is a Java applet that is supplied as a file called ptviewer.jar.

Typically it is embedded in a web-page using applet or object HTML tags, the ptviewer.jar file location is specified in the archive attribute:

 <applet
   archive="/path/to/ptviewer.jar"
   code="ptviewer.class"
   width="320"
   height="200">
   <param
     name="file"
     value="panorama.jpg" />
 </applet>

This has caused problems in the past with some Java virtual machines which have interpreted the archive path differently, generally web-site creators place the JAR archive in the same directory as the HTML page and specify the location like so:

 archive="ptviewer.jar"

To avoid having superfluous copies of the applet on a server, you can use this apache directive to make it appear that a single copy appears to exist in every directory:

 RewriteEngine on
 RewriteRule (^|/)ptviewer\.jar$ /websites/mysite/html/ptviewer.jar

(replace /websites/mysite/html/ptviewer.jar with the system path on your server)

This requires apache with mod_rewrite enabled. You can place the directive in the httpd.conf configuration file or in a ?htaccess file in the root of your site.