More Tutorials| Bioinformatics| Open Source| Photoshop| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Hello World in Echo3 framework 
 

Since "Hello World" example is everyone's favorite example therefore we will start our tutorial of Echo3/Echo Web Framework with the "Hello World" example in Echo3.

 

Hello World in Echo3 framework

                         

Since "Hello World" example is everyone's favorite example therefore we will start our tutorial of Echo3/Echo Web Framework with the "Hello World" example in Echo3. We have illustrated the first "Hello World" example in Echo3 with the server-side API. To create the first application you will need jar files of the Echo3. You can download Echo3 jar files from the following link:
http://echo.nextapp.com/site/echo3/download

In this example we have created two java files HelloWorldApp.java and HelloWorldServlet.java. HelloWorldApp represents the user instance of the the application and the HelloWorldServlet prcoess the HTTP connection and instantiate the HelloWorldApp application.

 

 

 

 

HelloWorldServlet.java

package helloworld;

import nextapp.echo.app.ApplicationInstance;
import nextapp.echo.webcontainer.WebContainerServlet;

public class HelloWorldServlet extends WebContainerServlet {

    public ApplicationInstance newApplicationInstance() {
        return new HelloWorldApp();
    }
}

HelloWorldApp.java

package helloworld;

import nextapp.echo.app.*;
import nextapp.echo.app.Label;
import nextapp.echo.app.Window;
import nextapp.echo.app.ContentPane;
import nextapp.echo.app.ApplicationInstance;

import nextapp.echo.app.event.ActionListener;
import nextapp.echo.app.event.ActionEvent;

public class HelloWorldApp extends ApplicationInstance {

 private WindowPane windowPane;

 public Window init() {
        Window window = new Window();
    window.setTitle("Hello World");
    ContentPane contentPane = new ContentPane();
        Label label=new Label("HelloWorld Application");
    contentPane.add(label);
    window.setContent(contentPane);
        return window;
    }  

One more thing you have to do before executing the application is that do the servlet mapping and servlet entry in the deployment descriptor web.xml

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>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>helloworld.HelloWorldServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/app</url-pattern>
</servlet-mapping>

</web-app>

To run this example follow these steps as given below:

  • Download Echo3 jar files
  • Place these jar files into the lib /WEB-INF/lib folder
  • Create java files, compile them and place into the  /WEB-INF/classes folder
  • Create and save web.xml file
  • Start your web server (e.g Tomcat Server)
  • Type the URL into the address bar http://localhost:8080/echo3/app

Output

Download Source Code

                         

» View all related tutorials
Related Tags: c ide server text application input button io user window click content value cli int this id ai server-side app

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.