NWS Tutorial

NWS framework Installation



Quick access:
   JAVA runtime installation
   Tomcat Server installation
   Installation of the demonstration application
   Installation of a new NWS application

JAVA runtime installation

NWS is a framework for Web applications development based on the Java language. The first step consists in installing a Java runtime environment on your development station. With this intention you have to go on the site of Sun Microsystems dedicated to java (http://java.sun.com) and to download the J2SE 6.0 (or any later version). If an adapted J2SE is already installed on your station, you can, of course, pass to the following section.

Once your download is finished, install it on your computer. The location of your J2SE installation have no importance: you can accept the suggested default location. You have also to accept the suggested options. Your computer is now able to execute the applications developed in Java.

Tomcat server installation

The following step consists in installing a Web server to be able to answer at the HTTP requests, which are necessary to your Web application. In theory, any server of applications compatible with the J2EE standard of Sun Microsystem, must allow the execution of Web applications developed by the NWS framework. Among the principal J2EE application servers, we can list:

Nevertheless, we do not need all the power which the J2EE platform brings to make function an application based on the NWS framework. Indeed, the J2EE standard provides a whole of very sophisticated services, but we need only one simple HTTP server.

The reference implementation, in term of HTTP server supporting Java, is called Tomcat : it is developed by the Apache Foundation, in partnership with Sun Microsystems. In fact, the J2EE applications server presented above, function all with Tomcat. Download Tomcat - it is normally diffused in the form of a ZIP file. This file functions as well under Windows platform, as Linux platform.

To install Tomcat, you just have to unzip the file. To start Tomcat, you will have to use the launching scripts which are located in the bin folder. Before that, I propose you to carry out a small modification in one of these launching scripts in order to simplify the start of it. But this handling depends on the operating system you use.

If you are on a Windows system, you just have to publish the file bin/startup.bat and to add at the head file the line which follows. That will make possible for Tomcat to know the localization of the Java runtime environment. If you did not install Java at the same place, take care to update the access path.

 
SET CATALINA_HOME=..
SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_02
		

In contrast, if you are under a Unix or Linux system, you have to publish the file bin/startup.sh in order to export correctly the PATH environment variable.

 
export CATALINA_HOME=<your tomcat install path>
export PATH=<your J2SE install path>
		

To start Tomcat, launch the script file associated with your operating system. Under Windows, a console must appear: do not close it without what you would close Tomcat.

Installation of the demonstration application

Now that your Tomcat server is installed, we will deploy the NWS framework example application. If you did not download it yet, make it by activating this link. The example application "Virtual Caddy" is diffused in ZIP format corresponding to a J2EE WAR .

You should now have to copy the application "Virtual Caddy" under the webapps folder of Tomcat. With this intention open the ZIP file which you downloaded: you will find a VirtualCaddy folder there. Copy this folder (and all its contents) directly in webapps.

Now you just have to test the application. For that, take a navigator (Internet Explorer or Firefox) and place you at the following address: http://localhost:8080/VirtualCaddy.

Installation of a new NWS application

You can, of course, deploy a new NWS application. The more simply to begin your development consists in downloading our distribution of the NWS framework: it is in fact a minimal WAR. You just have to code now your application there. The following chapter will enable you to acquire the necessary competences to the construction of your first NWS page.

CAUTION : NWS is proposed to you in BETA version to allow evaluation of this framework. Infini Software is released from any responsibility for the use of framework NWS. In addition, Infini Software can in no way be liable for the use of information contained in these tutorials.

Dominique LIARD - © 2007 SARL Infini Software - All rights reserved
Other brands and product names in these documents are the property of their respective owners.