Developing Web Applications With Ant by Richard Hightower - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Overview of Application Java Classes

The Java source code for this application is as simple as it gets for the Hello World Model 2 examples. Here is the Java application:

 

package xptoolkit;
import xptoolkit.model.GreetingFactory; import xptoolkit.model.Greeting; public class HelloWorld{
public static void main(String []args)throws Exception{ Greeting greet = (Greeting)
GreetingFactory.getGreetingFactory().getGreeting();
System.out.println(greet.getGreeting());
} }

As you can see, this application imports the GreetingFactory class and the Greeting interface from the model project. It uses GreetingFactory to get an instance of the Greeting interface, and then uses the instance of the Greeting interface to print the greeting to the console.