Home: Advanced Topics: JavaSketchpad and Web-Based Dynamic Geometry: Essential JavaSketchpad Folder Structure
Two components work behind the scenes to provide a dynamic Sketchpad illustration in a web page. The HTML file contains information that describes the geometric construction to be visualized in a language that JavaSketchpad understands. The applet—a separate set of files—provides the functionality that interprets this description, displays the figure in your visitors’ browsers, and lets them interact with it. You can have many HTML files containing different illustrations that all refer to the same applet, just as on your local computer you can have many sketch documents that can all be opened by the same copy of Sketchpad.
Before you create your first web page containing a construction, locate the JavaSketchpad applet itself. The applet consists of a folder titled JSP and the complete collection of files within that folder.
If you can’t find the JSP folder, you can reinstall it from your Sketchpad CD-ROM.
By default, when you installed Sketchpad, this folder was installed in the same directory as the Sketchpad application on your hard disk. You can copy the JSP folder from there to wherever you choose—into another folder, or onto your web server—but you should never change the contents of the folder itself. The applet only works if all of its files are in the JSP folder, with the same file and subfolder names as they had when the applet was first installed.
It’s essential that you know where the JSP folder is because a web browser must be able to access the JSP folder when it displays any web page containing a Sketchpad illustration. By default, web browsers assume that the JSP folder is located in the same place as your HTML file. Therefore, they’ll only work if you store the JSP folder (or a copy of it) in the same folder as the web page itself.
Experts. If you don’t want to store your HTML files in the same folder as the JSP applet, specify a relative URL from the HTML file’s base directory to the JSP applet directory anywhere on your server by modifying the <CODEBASE> parameter in your HTML file. See your HTML reference manual for more details.
For example, in the following illustration, the Triangle web page has been stored in a folder (in this case, named Web Folder), also contains a copy of the applet folder (JSP). This is the correct relationship between web pages you create and the JSP applet that a web browser requires, whether the containing directory (in this case, Web Folder) is on your local hard disk or your web server. If you don’t store the JSP folder in the same folder as your HTML file, the web browser will not be able to locate the applet and, therefore, won’t display your Sketchpad illustration when you open the HTML file that describes it.
|
|
Proper folder structure (Windows and Macintosh) |
See
also
Creating a JavaSketchpad Web
Page
Web Publishing Overview
Modifying and Publishing Your Pages
What Can Go Wrong