Over a million developers have joined DZone.

Interview: Amr ElAdawy, JSPX Java Web Framework Developer

DZone's Guide to

Interview: Amr ElAdawy, JSPX Java Web Framework Developer

· Java Zone ·
Free Resource

Atomist automates your software deliver experience. It's how modern teams deliver modern software.

Amr ElAdawy is a software engineer at Etisalat Egypt in Cairo. Etisalat is an Egyptian Mobile operator, where Amr develops Java enterprise applications for telecommunications & sales.

He is a member of a small community that is developing and supporting a web framework called "JSPX" . (Its homepage is here.)

Yet another web framework? 

Looking into the existing frameworks for developing Java web applications, we found that each requires a lot of knowledge and time before one can become productive with it. We wanted something that is easy to learn, productive, and (most of all) developer friendly. Hence we developed JSPX.

JSPX's main target is to be a "developer friendly" framework. Since JSPX is based on standard HTML tags and simple Java POJOs:

  1. JSPX is easy to learn. We already involved some fresh developers with basic knowledge of HTML and Java and no knowledge whatsoever of the framework... and they managed to start being productive in a remarkably short time.

  2. The out-of-the-box components that implement common tasks, such as DataTable, ListTable, Validators, and Capatcha are very powerful.

  3. Utilization of declarative code with full controllability, which is the ability to interact with the declared HTML controls through Java APIs is a fundamental concept in this framework.      

How does declarative code make JSPX different?

JSPX is smart enough to know what you need it to do without your needing to tell it how to do so. You only need to declare some attributes in your HTML pages to change the behavior of the results. For example, by setting the value of the "AutoBind" to "True", in a DataTable component, will a data table automatically connect to a database, without the need for any Java code at all.

Here are some of the DataTable tags:

To give us a visceral idea about what JSPX entails, can you give us a "Hello World" scenario?

Hello World with JSPX is very simple. Only three steps will get you on the road:

  1. Configure web.xml file. Just register two servlets and choose your URL pattern:



  2. Create HTML file with the extension you chose in the URL pattern. For example FirstPage.jspx in the Webroot folder:
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    controller="FirstPage" >
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>jspx demo</title>
    <form method="post" enctype="multipart/form-data" >
    <label id="resultLabel"></label>
  3. Create a Java class. It must have the same name as defined in the controller attribute in the HTML page's tag "jspx.demo.web.controller.FirstPage":
    public class FirstPage extends Page {

    protected void pageLoaded() {
    resultLabel.setValue("Hello Web in JSPX");


    public Label resultLabel = new Label();

    public Label getResultLabel() {
    return resultLabel;

    public void setResultLabel(Label result) {
    this.resultLabel = result;


Now you can start and try to access this url http://localhost//jspx-demo/pages/FirstPage.jspx.

Now please tell us exactly how an HTML file in JSPX is different to normal HTML files.      

Looking at the above example, we can see that the page contains standard HTML tags, except for the root element which is <page>. That is one of the most important features of JSPX: the ability to port an already-designed HTML page into JSPX pages. Just wrap the HTML within <page> tags! JSPX is built on top of all HTML standard tags. However, when going into some advanced business cases, such as database searches, one would require some non-standard tags that are specific to JSPX (as shown in the screenshot earlier in this interview).

What exactly is defined in the POJOs and how are they hooked into the HTML files? 

The controller code, which is a simple POJO class, is a representation of the HTML declarative code on the JSPX page. In the page, you see the attribute "Controller" in the Page node. This defines the name of the controller class. In this controller, you can define web controls that have the same name as the value of the ID attribute in the HTML page.  So, you will be able to interact with them. Also, through this controller you are exposed to a set of inherited methods to control all the phases of  JSPX. In addition to that, there are advanced binding techniques, via the JspxBean control, which are almost the same as JSF backing beans.

What about configuration files, like struts-config.xml? 

The approach taken in configuration is one of the most important advantages of JSPX. Our main goal from the start has been to eliminate the headache of configuration files. Unlike JSF and Struts, JSPX does not require any configuration files, other than the standard web.xml file. Hence, JSPX can be considered a "Zero Configurations Framework".

Are there any disadvantages to using this framework? 

Using relatively new frameworks is considered a risk for some people. In JSPX, we looked into the other frameworks and we covered almost everything that is needed and missing. Also, we provided the ability to use JSPX with already developed projects that were made in different technologies like JSF and JSP. Also, we support including already-made JSPs into JSPX pages.

Are you using the framework in production code and what are the results of doing so? 

Over the past 5 months, since the first announcement of JSPX, it has been used in at least five of our enterprise projects. Some of them have been totally migrated to JSPX. Others were already created in different technologies and JSPX was used to implement new requirements. In all of these cases, JSPX provided outstanding productivity. Top management has been very pleased about our time-to-market. In fact, we were able to deliver requirements that were planned to take days in just an hour!

What are the future plans of this framework?

The first JSPX release was announced on the 1st of January 2009... and the framework will not stop there! There is a plan for monthly releases, aiming to include bug fixes and new features. We are planning to provide support for AJAX, which is scheduled in the next build. Also, a plugin for NetBeans IDE will improve the productivity of users of this framework.

Mainly we are counting on user feedback to drive this framework, as it is strongly characterized as a highly dynamic and business-case driven framework.

How to start using it?

Visiting the project website at  http://jspx-bay.sourceforge.net will give you a comprehensive starting point for JSPX. A demo project is also provided, demonstrating some use cases of the framework. And, of course, we are more than pleased to support any request at the JSPX support email: support DOT jspx AT gmail DOT com.


Get the open source Atomist Software Delivery Machine and start automating your delivery right there on your own laptop, today!


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}