Most programs for the rest of the semester (in particular, the servlets) will also be Java with HTML, so let's get it right.Set your Java source file permissions to be readable, NOT executable. For those of you who are not Unix-knowledgeable, you can check the permissions on a file by typing:
ls -l fname
If an "x" is in the first 10 characters (eg, "-rwxr--r--"), the file is executable. Change it by typing:
chmod 644 fname
This sets the permissions so that you can change the file (write) and web browsers can read it.
When we click on a link to a Java program that has embedded HTML tags, one of three things can happen:
I don't have the full picture yet, but the behavior depends on:
- the file is displayed in the browser window,
- a download box comes up, or
- the browser tries to render the file as an HTML web page, which looks very strange!
- the browser,
- the web server, and
- the file permissions.
Netscape seems to only try to render the file as a web page
if the file permissions are set to be executable. IE sometimes tries
to render the file as a web page even if the permission are NOT executable.
The web server does have some effect that I don't fully understand;
Java source files on ISE are never rendered, but they are on osf1.
Please set your file permissions to be NOT executable, it will make it easier for me to grade your future homeworks. Java source files should not be executable, but sometimes the permissions get set incorrectly. The reason this happens is that when a file is uploaded from a PC to a Unix box, DOS sometimes sets the default permissions to be executable. (DOS and Windows have a much simpler model for file permissions than Unix does.)