Trace: • First JVx Application (Step by Step)
This is an old revision of the document!
The aim of this tutorial is to create an application with the Enterprise Application Framework – JVx. Moreover, a quick overview of the framework's possibilities will be given.
The application's task is to display the data from a database table and make them editable. The application requests authentification with user name and password.
The following skills and tools are needed:
- Eclipse IDE (>= 3.4) with JDT (recommended: Eclipse IDE for Java EE developers)
- JDK 6.0 (1.6) or higher
- HSQLDB library (http://www.hsqldb.org)
- Database and SQL skills
This documentation covers the following areas:
-
- Client
- Server
Folder structure
To develop an application with JVx, a special folder structure is recommended. This simplifies the Build process and separates any dependencies between Client and Server. This structure is to be created as follows:
A conventional structure:
can also be used on request. However, the documentation refers to the recommended structure.
Folder | Description |
---|---|
rad | Contains application- and server-specific files. |
apps | Contains all available applications. Only one application is contained in this concrete example. |
firstapp | Contains the application with project configuration, sources, libraries. |
help | Contains the client (GWT) for the online help and help pages. |
libs | Contains all libraries which are necessary both on the client and the server. |
libs/client | Contains all libraries which are only necessary for the client. |
libs/server | Contains all libraries which are only necessary for the server. |
src.client | Contains all the sources which are only necessary for the client. |
src.server | Contains all the sources which are only necessary for the server. |
test | Contains unit tests for the client and server or the libraries. |
Once the folder structure has been created, copy the library jvxclient.jar to the folder libs/client and the library jvx.jar to the folder libs/server. Both libraries are contained in the JVx binary package.
Project configuration
Once the configuration steps have been performed, a new project can be created with Eclipse:
- File / New / Java Project
- Note that the project has to be set up in the application folder firstapp.
- Remove the src folder from the Source Folders
Set the folderssrc.client
,src.server
andtest
as Source Folder
- Add the
jvx.jar
library, from the project directoryJVxFirstApp/libs/server
- The project can now be created
The project is shown in Eclipse as follows:
Application development
On the server side, the application needs a configuration file for the settings that only concern the application. For the configuration of the server, an extra configuration file is needed. First we create the file for the application: