This reference page contains some important information about configuring
the codebase setting of your applets.
- Keep Your CodeBase Setting Consistent
- The Recommended Directory Structure/CodeBase Setting
- Changing The Codebase Setting (Advanced User's Only)
1. Keep Your CodeBase Setting Consistent
The uShopTM Java Applets can be added to any of your web pages
via the standard HTML <APPLET> tags, as shown in Figure 1 below.
Figure 1 Example uShop Applet HTML
Note that on the very first line of the applet, a CODEBASE parameter
is used to specify the location of the applet's class file.
IMPORTANT!
In order for uShop to function properly, it is important that this CODEBASE setting has
the EXACT SAME VALUE for ALL of your store's applets. Codebase settings such as:
codebase="../classes/"
codebase="../classes"
(missing last /)
codebase="../Classes/"
(first C is capitalized)
...may be similiar and may actually refer to the same "classes" directory on your
server, but not all browsers will interpret these codebases as being the same. So
just make sure you use the EXACT same value for the codebase setting of all of your
applets.
2. The Recommended Directory Structure/CodeBase Setting
As specified in the uShop
TM User's Guide, because uShop
TM is
Java-based and because various browsers on various operating systems handle caching
Java Applets differently, there is a specific directory structure that should be
used in order to maximize browser compatibility. This recommended directory structure
is based on years of experience in dealing with Java and the various browser
differences and is illustrated in Figure 2 below.
Figure 2 Recommended Directory Structure
With this directory structure, all of the uShop
TM class files would go in
the "classes" directory and thus, you would use the setting
codebase="../classes/" for all of your store's applets.
Figure 3 Recommended Codebase Setting
3. Changing The Codebase Setting (Advanced User's Only)
On rare occasions, it may be necessary to use a codebase setting other than the
default
and recommended setting of
codebase="../classes/". One such
instance might be if you write a custom CGI script that accesses a database and
dynamically generates the product pages with the uShop
TM applets on them.
For that case, you would actually need to use the FULL URL of your "classes" directory
for the codebase of all of your applets. For example:
codebase="http://www.yourdomain.com/classes/"
This sort of setting is acceptable, however, you would also need to make a couple
other changes as listed below:
- Change The CodeBase In The "display_cart.html" File
Open the "display_cart.html" file which is located in your "classes" directory and
change the codebase setting of the "uShopJSI" applet on that page to be your
new codebase.
- Change The CodeBase In The "display_product.html" File
Open the "display_product.html" file which is located in your "classes" directory and
change the codebase setting of the "uShopJSI" applet on that page to be your
new codebase.
- Add A "codebase" Parameter To Your uShopOrderButton Applet
uShopTM maintains a global variable of the "codebase" setting for use
when it dynamically generates the order process pages. This global variable
defaults to the recommended codebase="../classes/" setting, so if you change
the codebase you must change this global variable too. This can be done by adding
the following parameter to your uShopOrderButton applet:
<PARAM NAME="codebase" VALUE="http://www.yourdomain.com/classes/">
Where "http://www.yourdomain.com/classes/" is actually whatever new value you want to use
for the codebase.
Note that you can also set the uShopTM global codebase variable by adding
that codebase PARAM to the uShopInitialize applet too.