Segunda-feira Out 27, 2008

AJAX and NetBeans - jMaki and ZK

Hi everybody,

Last Thursday I did a Tech Demo about developing AJAX web apps using the powerful NetBeans 6.1 at Federal University of Rio de Janeiro.

I started talking about AJAX and how it improves usability and creates user friendly interfaces for the Web. Many people thinks that having ajax apps will overload the server and network just because you have a prettier interface. People have the idea that how more sophisticated is the app, heavier it will be. AJAX shows that it's not true.

The division of concepts let the server deal only with the data requested from Javascripts at client side. The interface refreshing is done all by the browser. So, instead of sending full and big HTML blocks to the client each time he refresh or navigate to a different page, the server just send the information requested and the browser deal with page drawing dynamically.

A great doubt about developing an AJAX app is to choose a framework. I suggested 2!

First I talked about jMaki. (

I did a demo showing the features of jMaki framework and its cool plugin for NetBeans.

jMaki is a client-server framework that encapsulates many AJAX components from other frameworks in the form of a Widget. With the NetBeans plugin, it let you create your pages dragging and dropping widgets to your JSP. You only need to customize your page changing the CSS file as you like and choosing the best widgets to compose your web page.

To start learning about jMaki, I suggest these links:
NetBeans jMaki Introduction Tutorial
jMaki Screencast
To get a little more advanced learning, try this Another jMaki NetBeas tutorial with RESTful WS

Later I started talking about ZK framework to build AJAX RIA using NetBeans.
When a friend showed me ZK, I got really impressed. It's a complete framework and it let you develop your app programming only in Java.

Yes! All the server side AND the client side scripts can be written in pure Java language (sweet Java)! Check some videos and examples at ZK Home Page

I did a simple demo using ZK to build a Web Telephone List.

WARNING: I don't use a database on this demo, but it's just to leave things faster. On a real world implementation , you should really consider that, specially because ZK has great tools to deal with Database and Persistence. If you understand Brazilian Protugese, check this blog post.

Now let's start our demo.

First, install NetBeans ZK plugin:
There are 2 plugin options:
1. ZK Designer plugins for netbeans 6.1
2. REM for NetBeans 6.0

The first let you develop your ZUL web pages dragging and dropping the components into your xml, but the second one is the one with code completion and highlighting.

Actually, in a very near future they will became only one plugin. Stay tuned for next release of REM plugin because it will came with the visual ZK designer bundled too!

Download the plugin and install it on NetBeans through the Tools->Plugins window.

For my Demo, I chose the first plugin that let me create my pages faster using drag n drop.

So now, let's create a New Project.

1. Go to File -> New Project
2. Choose a new Web / Web Application
3. Choose a name for your project (like ZKDemo)
4. Choose your server (GlassFish)
5. Choose the framework you would like to use. Here you must choose ZK!

The project opens with two index files: the index.jsp and index.zul. Delete the JSP and keep the ZUL. ZK support JSP includes, but its main ajax components are arranged to compose your web page on a XML file called ZUL file.

The index.zul file comes with a simple window page like this:

Try some drag and drop with the ZK components of the palette and then Run you project to check some ZK features!! Not all the ZK components are already on the palette! To see a full list of ZK Components, check: ZK Explorer!

For our Telephone List project you will need this index.zul file.
Copy it's content on your index.zul.
You will also need the catalog.zul file that is included on our index.zul and the catalog.zs file that is used by the ZSCRIPT tag on the begining of the index.zul file.

Just save catalog.zul and catalog.zs on your project page at your NetBeansProjects/YourProjectName/Web folder!.

Then go to NetBeans and open the ZS file. Look! It's Java code! No Javascript in here :D! See that it does 2 imports:

import ufrj.zkdemo.Catalog;
import ufrj.zkdemo.Contact;

This classes need to be created! But it's quite simple! Remember that if you create your classes on a diferent package, you will need to update the ZS file with yourpackage.Catalog and yourpackage.Contact imports!

Download class.
Download class.

And put them on your project's source code packages!

Now Run your application and enjoy your veeeery simple telephone ajax catalog! See that, since we are using Lists and a Map to store the data, every time you Refresh your Web Page, you will have your telephone data ERASED!! Yes, this is not a very useful Tel catalog, but I encourage you to improve this project using a Database! ;)


Segunda-feira Ago 18, 2008

Developer Web Days 2008

Hi everybody,

This Friday I will give a Tech Talk at Developer Web Days 2008 meeting, here on Brazil.

At 9:00 o'clock, I will be in Room A, talking about Web Development using AJAX and NetBeans:
I will give a little overview about AJAX and show how to easily construct and deploy AJAX content on your projects without Javascript, using the outstanding jMaki framework and the amazing ZK framework. I will possibly show the Dynamic Faces project with AJAX too.

at 18:30 o'clock, I will be attending Room D, talking about Service Oriented Architecture (SOA), Web Services and EJB. On this presentation, I will talk about how to support SOA with EJB, using them as web services and orchestrating them with BPEL, constructing your own composite application. Using the Open ESB SOA plugin for Netbeans, I will make almost everything visually, what makes it easy to understand and use later.

You can find more Information about the event at

After the presentations I will post the demos' Tutorials right here on this blog!! Stay tuned.


Segunda-feira Dez 03, 2007


Today they released the amazing new NetBeans!! Try it and get amazed too!


Segunda-feira Set 03, 2007

Artigo para o IST-RJ

Olá a todos! Desta vez falando em português! Estou postando aqui um artigo que escrevi para realizar a inscrição na Semana Tecnológica e Cultural do Instituto Superior de Tecnologia aqui do Rio de Janeiro. Leiam e opinem!

Abstract: This paper starts from the notice of a a greater competitiveness on the actual market. The IT professional, therefore, should have a knowledge capable of making the organization it works more competitive. Sun Microsystems believes, supports and invest on Open Source technology, letting that the users community could intervene and improve market consolidated tools as Java platform, the Solaris operating system and NetBeans development environment.
Resumo: Este artigo parte da constatação da maior competitividade do mercado atual. O profissional de TI, portanto, deve dotar de conhecimento capaz de tornar sua organização de trabalho mais competitiva. A Sun Microsystems acredita, apóia e investe em tecnologia de código aberto, deixando que a comunidade de utilizadores possa intervir e melhorar ferramentas consolidadas no mercado tais como a plataforma Java, o sistema operacional Solaris e a ambiente de desenvolvimento NetBeans.
[Read More]

Segunda-feira Abr 09, 2007

Info News

Hi evbdy,

The info EXAME magazine made a research about Brazilian enterprises and selected the top 100 in the usage of TI. Together, they showed statistics about the Operating Systems they use in their servers. It's said that 41% of the enterprises have Solaris installed, 43% have IBM AIX, 61% have RedHat Linux, 78% have Windows2000 and 96% have Windows Server. HP UX stays with 38%, Windows NT with 35%, SUSE with 26%, Netware 15%, Debian 14%, Mandriva 3%, and others 22%.
About the most used development technologies, Java stays on the TOP, being used at 73% of the enterprises. VB and ASP.Net stay with 67%, C/C++ with 35%, PHP with 34%, C# with 31%, Delphi with 28%, Ajax 27%, Cobol 27%, Cold Fusion 27% and others with 33%.
I think it's good for us to know this kind of information.

Well... Let's keep this blog updated for now on!!


« Abril 2014