Java and Java Applets

Any Java tutorial starts with an understanding of the environment where your Java code will run. When developing using java, it is important to have a web server or an application server that will allow you to upload your web pages and applications and run them using the http prefix rather than the file itself. There are many servers available on the internet and you will need to download one if you do not have. It is easy to find a free web server for evaluation and development which you can use for your projects.

Assuming that you have the web server installed, the next step in your Java tutorial is to know where to place your files and how to access the files from your browser. This is important since different web servers have different folders where uploaded content must be placed in order to be run from the web server. Once you are through with this step, you need to create a simple file to test your web server. Most Java tutorial sites will ask that you define a simple file with the message Hello, World. Consult your web server documentation to find out how you can access your first web page.

Embedding Java into web pages and web applications gives it a dynamic look. The most popular of these is Java applets that are run inside a web page and allow interactive dynamic web page designs. Lets analyze Java applets and see what they can do. To start any Java tutorial on creating Java applets will tell you that unlike Java applications which are standalone and can be run from within Windows or from the command line, applets cannot be run independently. They must be run from inside a web browser. The applets code is referenced using special HTML tags telling the browser to load the applet from the web server and executing it on the local machine. The convenience of structure and UI capabilities also mean that applets can be downloaded and run from anywhere and can thus be used to cause system damage or security breaches. You will therefore not find a Java tutorial that shows you how to read or write to a file system except for specifically defined user controlled list of directories. Any applet you create will also not be able to communicate with any other server except from where it is stored. They will also not be able to load native programs to the local platform including shared libraries like DLLs or run other programs other than those on the local machine. This balance of flexibility and security makes java applets safe and convenient for rich web applications.



Tags: , , , ,


Search for Information On