Team Fly |
Standalone applications can be written in Java similar to C, C++, Fortran, and so on. All Java source programs contain a .java extension. Then the source code is compiled into bytecodes, the compiled program having a .class extension. The Java compiler is javac. The Java interpreter is Java. The Java interpreter looks for a class file name by default, the extension does not need to be specified.
Compile a Java application from a UNIX prompt. This generates a HelloWorld.class file:
$ javac HelloWorld.java
Execute a standalone Java program (HelloWorld.class) from a UNIX prompt:
$ java HelloWorld
Applets are Java client applications designed to run inside the JVM of a browser, which can leverage the graphical capabilities of a browser. An HTML file can contain an instruction to load an applet locally or from an application server. Applets work best for applications that run on an intranet inside a firewall. When developers are writing applets, they are writing GUI applications that will run in a browser and which are loaded locally or from an application server. A Java plug-in and a security policy file may be required for the applet to run successfully.
A JavaBean is a reusable software component written in Java that conforms to a particular specification. This makes it easy to plug and play a JavaBean into another Java component. JavaBeans can be visible or nonvisible, the latter of which are used in GUI applications.
JavaServer Pages (JSP) is an approach for generating dynamic web pages. JSPs contain the content display instructions from the business logic, as well as XML tags and scriplets written in Java that define how to display the web content. Compiled into servlets, they allow graphic designers to write powerful dynamic web pages.
A servlet is a Java program that runs in the J2EE server versus the browser on the client (applets). A servlet will get the data, convert it to an HTML format and download the HTML instructions to a browser. Though they can be written to provide the dynamic web content, JSPs are much easier to write, since servlets need
Team Fly |