Opening a new window in Echo3
In this example of Echo3 (server-side application) we will create a new Window. To create this example we have created two class files WindowServlet.java and WindowApp.java. WindowApp.java is responsible for creating the application user interface through which the user will interact. WindowApp class extends the abstract class ApplicationInstance
The init() method is used to initialize the state of the user interface for a user. It must return an Echo Window object representing the state of the initial window of an application. Here we have created a new Window by constructing the object of WindowPane. Further we have created the class WindowServlet which extends the WebContainerServlet for handling HTTP request to the servlet. WindowServlet will call the WindowApp class. Here is the full source code of WindowServlet and WindowApp as follows:
WindowServlet.java
package window;
|
WindowApp.java
package window;
|
Do the servlet entry and servlet mapping into the deployment descriptor file web.xml
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>Interactive Test Application</display-name> <description> An interactive application to test features of the Echo Platform. </description> <servlet> |
Output :
Type the following URL into the address bar http://localhost:8080/echo3/winapp