In this sample server-side application we have created an application which contains the window from where the user can input a text and this value would be shown into the content pane when user will click on the "Ok" button.
For creating this sample application we have created two java files InputTextServlet.java and InputTextApp.java. InputTextApp class extends an abstract class ApplicationInstance and represents the state of user interface. Each and every user who will invoke the application would contain its own unique instance. The init() method is used to initialize the state of the user interface for a new user. It should return an Window object representing the state of the initial window of an application. InputTextServlet extends the WebContainerServlet and it is responsible for invoking a new application instance which will return a new application instance for the InputTextApp.
InputTextServlet.java
package inputText;
|
InputTextApp.java
package inputText;
|
To run this sample application create and save InputTextServlet.java and InputTextApp.java and compile them. Place these class files into the /WEB-INF/classes folder.
Do the servlet entry and servlet mapping into the deployment descriptor 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> </web-app> |
Output:



If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Simple input application in Echo3
Post your Comment