samaxes

samaxes logo

Ramblings about Open Source, Java and other Web technologies by Samuel Santos

Java Web Development with Stripes

Stripes Framework presentation for the Portuguese Java User Group session on the JavaPT09 event.

The used source code is also available.

Stripes and jQuery Autocomplete

I really enjoy jQuery. But finding the right UI widget can be a daunting task.
Autocomplete is one of those widgets.

I decided to share an asynchronous example on how to use the jQuery Autocomplete plugin with Stripes.

Here’s an example output:
Stripes and jQuery Autocomplete example
Read the rest of this entry »

Stripes and jQuery: AJAX forms and HTTP Session Validation

This example was greatly inspired by the Stripes and jQuery AJAX Forms article from Freddy Daoud, but with some nice improvements

Last week I was working on a new Stripes/AJAX example. It involves having a table listing entities, being the last row of the table a form for adding new ones.
The form gets submitted via AJAX, using jQuery, and the response is validated in order to check if the HTTP session is still valid.

If everything is OK, the list is refreshed and a success message appears. On the other hand, if validation errors occur, the list is refreshed and an error message appears.
Also, if the user’s session has expired on the server, an alert is shown to inform the user that his session is invalid, and the page is reloaded so the user can login once more.
Read the rest of this entry »

BIRT/Stripes example

A long time has passed since my previous BIRT examples Deploying BIRT Report Engine API with Jakarta Struts and Deploying BIRT Report Engine API with Stripes.
Although they have received a lot of attention and downloads, the examples were really basic and are now outdated.

Since I had to use BIRT in my last projects I decided to update my BIRT/Stripes example.
This example doesn’t depend on the Tribix project anymore since BIRT supports HTML/Paginated HTML, PDF, Excel, Word, PowerPoint, and PostScript outputs (images/charts are not embedded in Excel output).

BIRT WebReport Example

I’ve tried to follow some good practices that I think are important to use in a production application:

  • There is a significant cost associated with creating an engine instance, due primarily to the cost of loading extensions. Therefore, each application should create just one ReportEngine instance and use it to run multiple reports. In this example the engine is started in the context listener and the same instance is always used.
  • All texts in the report should be loaded from the resources so the application can be fully localizable and fully internationalized.
  • You should use a JDBC data set to preview your report with BIRT designer but you must swap the data set in runtime to use data from your business logic.
  • You should use predefined styles instead of custom styles as much as you can.
  • Not a good practice but often a requirement, hide the master page when generating a HTML report, and change the visibility of elements so they are visible only to specified outputs.

For this example BIRT Runtime Engine 2.2.2 2.3.1, and Stripes Framework 1.5 were used.
Read the rest of this entry »

Stripes and EJB3

Inspired by the Spring with Stripes integration I made a new one named EJB3 with Stripes.

This extension allows you to inject your EJB beans into your Action beans.

Please fell free to use it, and to visit the Stripes and EJB3 project at Google Code.

Deploying BIRT Report Engine API with Stripes

Now that I use preferably Stripes over Struts Framework, I’ve decided to port my example “Deploying BIRT Report Engine API with Jakarta Struts” to this Framework.

BIRT WebReport Example

For this example I’ve used Stripes 1.4.2, BIRT Runtime 2.1.2, and Tribix 2.1.2.
Read the rest of this entry »

Comparison between Stripes and JSF

Reading the TheServerSide.COM news I’ve found a comparison’s article between Stripes and JSF frameworks.

I can’t agree more with the author Gregg Bolinger when he says Since I stumbled on Stripes, I’ve found it to be the best all around framework for my purposes.

Read it at “Stripes and JSF: A Brief Comparison“.

Sponsors