| Home > Advance
Java FAQ
> Browsers FAQ |
| Browsers |
| |
|
Q . When will my favorite browser support Java 1.1?
|
Ans :
All popular browsers now have JDK 1.1 support. Netscape
Communicator 4.04 plus patch "J" fully supports the features of Java
1.1. It was released in December 1997, and is only missing the JavaSoft
support for applet signing (Netscape has gone its own way on this). See http://developer.netscape.com/support/faqs/champions/java.html#21 If you have Netscape 4.05, and the console says anything other than
Java 1.1.5 then you do not have a fully 1.1 compliant Netscape. There
is a special preview version available here: http://developer.netscape.com/software/jdk/download.html
Netscape badly fumbled its Java support in 1997 as its market was seized by Microsoft. Microsoft is using IE as a strategic tool to
deploy what Microsoft employees call "polluted Java". For both of these
browsers, the Java Plug-in is currently a good approach.
Sun's HotJava browser fully supports the JDK 1.1 features. People who are obliged to use a browser without standard Java support should use
the Java Plug-In. The Java Plug-In substitutes a standard Java virtual
machine for the one that shipped with the browser. It allows you to use
RMI, JavaBeans components, and Java Foundation Classes in Internet
Explorer 3.02, 4.0, and 4.01. The Java Plug-In also works flawlessly
with Netscape browsers. You can download the Java Plug-In from http://java.sun.com/products/. Note that you need to change the HTML a little, to ensure that the
plug-in JVM is invoked, not the browser JVM. A tool is included to do the changes automatically.
|
|
Q . Is it possible to set and retrieve cookies from Java, in a manner that is compatible with all browsers supporting cookies?
|
Ans
:
Short answer: no.
Longer answer: probably no.
Ultimate answer:
A cookie is a morsel of tasty data that a server sends back to the client, and can retrieve on demand. It allows the server to retain some
state information for each of its clients. The information is typically
something like "what pages has the user seen?" or "is this a privileged user?".
The DevEdge site on Netscape's home page has a Javascript-Java example on getting cookies. Also
http://www.geocities.com/SiliconValley/Vista/1337
has info on connecting an applet with JavaScript functions. It's quite involved.
Stick to just Java if you can.
|
|
Q . I am developing an applet and testing it in Netscape Navigator. I find that after I recompile, I press reload, clear the caches, retype the URL of the HTML wrapper, and I still have the old version. Why is this?
|
Ans
:
Note: a reader reports that as of Netscape Communicator 4.05 it is
possible to force the browser to reload the applet by holding down
"control"+"shift" while clicking "Reload" In the past Netscape has completely failed to improve the defective
code that does this monstrously wrong thing. It has been like this for
many successive releases. Flushing the network cache will make no difference; that isn't where
the caching is taking place. Although applets are sometimes "pruned" and their ClassLoaders garbage-collected, this doesn't happen
predictably, so restarting Netscape is the only reliable work-around at
the moment. A related question is "how do I make the browser reload from a
URLConnection instead of just getting the content from the local cache?" The answer is to use
java.net.URLConnection.setUseCaches(false)
Browsers seem to vary in their conformance to this programmatic request. Netscape caching varies depending on whether a proxy server is
in use, and which thread in the applet made the get request.
Another approach is adding "?" to the URL, e.g.
http://www.somesite.com/webcam/image.jpg?100 and increasing this number each time the Applet fetches the image.
|
|
Q . Why didn't Netscape reload the applet when you pressed the Reload button?
|
Ans
:
For the applet to be reloaded, the new version would have to be
loaded in a different ClassLoader. Navigator/Communicator's policy for
assigning ClassLoaders to applets doesn't take into account whether a
reload has been done (although there is no technical reason why it
couldn't).
Some versions of Netscape reload the Applet if you use Edit/Preferences/Advanced/Cache to Clear Memory Cache and Clear Disk
Cache, then <Shift> while you click on reload. In Explorer, use View/Options/General/Delete Files, then <Control>
'Reload' button to reload the page containing the applet.
Until they fix it, use the appletviewer to test applets. And send them mail - developers can only fix the bugs they know about.
|
|
Q . Should I use Microsoft CAB files or Java JAR files?
|
Ans :
The question contains its own answer.
CAB format is a Microsoft-only format. So do not use it as it destroys software portability.
JAR format is the Java standard format, based on PKZIP format including data compression. JARs were introduced with JDK 1.1.
See http://www.ibm.com/java/community/viewarchive4.html
for more information.
You should use the Java standard format JAR (Java Archive) files, not a vendor-specific format. JAR files are not just a Java standard, they
are in industry-standard PKZIP format. One reader comments that both
formats can be used with this tag:
<APPLET NAME=myapplet
ARCHIVE="myzip.zip"
CODE="com/nnnnn/nnnn/cccccccc.class"
WIDTH=n
HEIGHT=n>
<PARAM NAME="cabbase" VALUE="mycab.cab">
</APPLET>
IE3 does not support JAR
IE4 supports compressed and uncompressed JAR, but not signed JAR
|
|
Q . How can I tell the version of Java that my browser supports?
|
Ans
:
See
http://java.rrzn.uni-hannover.de/insel/beispiele/vertest.html
. This page tells you whether your browser supports JDK 1.1.
See http://www.uni-kassel.de/~pfuetz/Properties.html
This page tells you which classes you may expect to be present in the browser's
runtime.
|
|
Q . How can I tell the options/commands that Netscape's JVM takes?
|
Ans
:
You can open the Java Console and type a "?" to get a list of all
the commands/options available to you in Netscape's built-in JVM.
|
|
|