Difference between revisions of "Historical:Have a single ptviewer jar file per website"
m (workaround wikimedia dot htaccess bug) |
Erik Krause (talk | contribs) m (Erik Krause moved page Have a single ptviewer jar file per website to Historical:Have a single ptviewer jar file per website) |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | [[PTViewer]] is a [[Java]] applet that is supplied as a file called <tt>ptviewer.jar</tt>. | + | {{delete|to Historical}} |
+ | [[PTViewer]] is a [[Java]] applet for interactively displaying [[equirectangular]] | ||
+ | panoramas that is supplied as a file called <tt>ptviewer.jar</tt>. | ||
+ | |||
+ | '''Java applets were deprecated since Java 9 in 2017 and removed from Java SE 11 (18.9), released in September 2018.''' | ||
Typically it is embedded in a web-page using ''applet'' or ''object'' HTML tags, the | Typically it is embedded in a web-page using ''applet'' or ''object'' HTML tags, the | ||
Line 11: | Line 15: | ||
<param | <param | ||
name="file" | name="file" | ||
− | value="panorama.jpg" /> | + | value="/the/path/to/panorama.jpg" /> |
</applet> | </applet> | ||
− | This | + | This causes problems with some [[Java]] virtual machines which require extra resources |
− | + | such as the file <tt>panorama.jpg</tt> to be in the same folder as the applet itself | |
− | [[JAR]] archive in the same directory as the HTML | + | (or in a subfolder) � Generally web-site creators place the [[JAR]] archive and |
+ | [[JPEG]] image in the same directory as the HTML, then specify the locations without | ||
+ | full paths: | ||
− | archive="ptviewer.jar" | + | <applet |
+ | archive="ptviewer.jar" | ||
+ | code="ptviewer.class" | ||
+ | width="320" | ||
+ | height="200"> | ||
+ | <param | ||
+ | name="file" | ||
+ | value="panorama.jpg" /> | ||
+ | </applet> | ||
− | To avoid having superfluous copies of the applet on a server, you can use this apache | + | To avoid having superfluous copies of the applet on a server for every directory, you can use this apache |
− | directive to make it appear that a single copy appears to exist | + | directive to make it appear that a single copy appears to exist throughout the site: |
RewriteEngine on | RewriteEngine on | ||
Line 31: | Line 45: | ||
This requires apache with ''mod_rewrite'' enabled. You can place the directive in the | This requires apache with ''mod_rewrite'' enabled. You can place the directive in the | ||
<tt>httpd.conf</tt> configuration file or in a <tt>.</tt><tt>htaccess</tt> file in the root of your site. | <tt>httpd.conf</tt> configuration file or in a <tt>.</tt><tt>htaccess</tt> file in the root of your site. | ||
+ | |||
+ | |||
+ | [[Category:Tutorial:Specialised]] |
Latest revision as of 18:19, 5 June 2020
PTViewer is a Java applet for interactively displaying equirectangular panoramas that is supplied as a file called ptviewer.jar.
Java applets were deprecated since Java 9 in 2017 and removed from Java SE 11 (18.9), released in September 2018.
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="/the/path/to/panorama.jpg" /> </applet>
This causes problems with some Java virtual machines which require extra resources such as the file panorama.jpg to be in the same folder as the applet itself (or in a subfolder) � Generally web-site creators place the JAR archive and JPEG image in the same directory as the HTML, then specify the locations without full paths:
<applet archive="ptviewer.jar" code="ptviewer.class" width="320" height="200"> <param name="file" value="panorama.jpg" /> </applet>
To avoid having superfluous copies of the applet on a server for every directory, you can use this apache directive to make it appear that a single copy appears to exist throughout the site:
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.