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“.
If the J2SE platform has come a long way in internationalization, entering non-ASCII text in the J2EE world isn’t nearly as easy.
To achieve the same result you have to make some changes in your code and in your web server settings.
Firstly, to make sure that the right value in the Content-Type header precedes the text/html content so your browser correctly auto-detects the right encoding, place the following declaration at the beginning of the JSP:
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" %> |
Next you have to create a filter that implements the ‘javax.servlet.Filter’ interface so you can have the request parameters encoded with UTF-8:
package com.samaxes.filters;
import javax.servlet.*;
import java.io.IOException;
/**
* Filter called before every action.
*
* @author : samaxes
*/
public class UTF8Filter implements 1.5.0/docs/api/java/util/logging/Filter.html">Filter {
public void init(FilterConfig filterConfig) {
}
public void destroy() {
}
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse,
FilterChain filterChain)
throws 1.5.0/docs/api/java/io/IOException.html">IOException, ServletException {
servletRequest.setCharacterEncoding("UTF-8");
filterChain.doFilter(servletRequest, servletResponse);
}
} |
Now, your server reads the URL POST parameters correctly…
But there still is an issue - during a GET operation.
The trouble is that none of the charset information gets sent back to the web server during a GET or POST operation. The server has no way of knowing how to interpret the url-encoded GET parameters, so it assumes ISO-8859-1.
Fortunately the solution to address this is pretty simple, just specify URIEncoding="UTF-8" in your Tomcat’s connector settings within the server.xml file.
Your application shall now handle UTF-8 just fine.
The news article from InfoQ:
This morning Sun officially released Java 6 for download after over two years of development. The Java 6 development cycle has been the most open of any Java release with weekly builds available to the public and extensive collaboration between Sun and over 330 external developers. Sun has worked with over 160 companies to ensure backwards compatibility, stability and optimum performance of applications running on the JVM. Java 6 included a number of focus areas. From the press release:
Web 2.0
The Java SE 6 software helps accelerate developer innovation for web-based, dynamic and online collaboration applications by including a new framework and developer APIs to allow mixing of Java technology with dynamically typed languages, such as PHP, Python, Ruby and JavaScript(TM) technology. Sun has also created a collection of scripting engines at: http://scripting.dev.java.net and pre-configured the Rhino JavaScript engine in the Java SE 6 platform. In addition, the Java SE 6 software includes a full web services client stack and supports the latest web services specifications, such as JAX-WS 2.0, JAXB 2.0, STAX and JAXP.
Diagnostics, Monitoring, and Management
The Java SE 6 platform provides expanded tools for diagnosing, managing and monitoring applications and also includes support for the new NetBeans Profiler 5.5 and for Solaris(TM) DTrace, a comprehensive dynamic tracing framework for the Solaris 10 Operating System (OS). In addition, the Java SE 6 software further increases ease of development with tool interface updates for the Java Virtual Machine (JVM (TM)) and the Java Platform Debugger Architecture (JPDA).
Enterprise Desktop
The Java SE 6 release delivers significant improvements to the desktop, which enable Java applications to integrate even more seamlessly into the end-user experience. For rapid visual development of interactive applications, the Java SE 6 platform includes a new layout manager component, based on the NetBeans GUI Builder (formerly code named Matisse). The Java SE 6 software also provides enhanced support for the upcoming version of Windows Vista.
InfoQ discussed the Java 6 release with Bill Curci, Product Marketing Manager for Java Platform Standard Edition and Danny Coward, Java SE Platform Lead. Among the items they highlighted:
A good summary of the main features included in Java 6 can be found in InfoQ’s previous coverage “Top 10 New Things You Need to Know About Java 6“.
It’s finally here as you can see in Free and Open Source Java.
The key behind moving to the GPL is to drive more volume and more adoption for the platform. The GPL helps get Java into some markets that it hasn’t served as fully as it should - such as educational markets, governments in the developing world, and some commercial customers - as well as, obviously, some distributions of Linux which insist not on Linux-friendly licenses but on actual GPL licensing.
GPLv2 was chosen over GPLv3 for fairly obvious reasons: GPLv3 isn’t finished yet! Sun is, they said, working with the FSF on defining GPLv3.
Read the complete news.
The first development build (2.0.1) of Apache Struts 2 project has been released.
From Planet Struts News:
Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities joined forces to create Struts 2. This new version of Struts is designed to be simpler to use and closer to how Struts was always meant to be. Some key changes are:
- Smarter!
- Improved Design - All Struts 2 classes are based on interfaces. Core interfaces are HTTP independent.
- Intelligent Defaults - Most configuration elements have a default value that we can set and forget.
- Enhanced Results - Unlike ActionForwards, Struts 2 Results can actually help prepare the response.
- Enhanced Tags - Struts 2 tags don’t just output data, but provide stylesheet-driven markup, so that we can create consistent pages with less code.
- First-class AJAX support - The AJAX theme gives interactive applications a significant boost.
- Stateful Checkboxes - Struts 2 checkboxes do not require special handling for false values.
- QuickStart - Many changes can be made on the fly without restarting a web container.
- Easier!
- Easy-to-test Actions - Struts 2 Actions are HTTP independent and can be tested without resorting to mock objects.
- Easy-to-customize controller - Struts 1 lets us customize the request processor per module, Struts 2 lets us customize the request handling per action, if desired.
- Easy-to-tweak tags - Struts 2 tag markup can be altered by changing an underlying stylesheet. Individual tag markup can be changed by editing a FreeMarker template. No need to grok the taglib API! Both JSP and FreeMarker tags are fully supported.
- Easy cancel handling - The Struts 2 Cancel button can go directly to a different action.
- Easy Spring integration - Struts 2 Actions are Spring-aware. Just add Spring beans!
- Easy plugins - Struts 2 extensions can be added by dropping in a JAR. No manual configuration required!
- POJO-ier!
- POJO forms - No more ActionForms! We can use any JavaBean we like or put properties directly on our Action classes. No need to use all String properties!
- POJO Actions - Any class can be used as an Action class. We don’t even have to implement an interface!
Struts 2 key features
- A flexible, plain old Java object (POJO)-based architecture to structure your code and pages, yet stay out of your way.
- A theme-enabled tag library supporting JSP, Velocity, and Freemarker.
- Built in support for complex Javascript and Ajax widgets.
- A simple plugin framework to integrate with third-party libraries like JavaServer Faces, JasperReports, and JFreeChart.
- Built-in debugging tools supporting profiling, problem reports, and interactive object model queries.
- Automatic portlet support allowing portal and servlet deployments with no code changes
- Quick start development tools like Maven archetypes, automatic reloading configuration files, and bootstrap tutorials.
Other Resources
Great news for embedded devices developers.
Eclipse has recently released the embedded Rich Client Platform (eRCP) 1.0.
eRCP is for J2ME what RCP is for the desktop, and includes among other things
- Eclipse Core which provides OSGI and Extension Point Framework support
- a version of SWT called embedded Standard Widget Toolkit (eSWT)
- eJFace a set of classes which enable eRCP applications to integrate with an eRCP workbench, and provide more complex widgets like MVC oriented viewers
- eUpdate for dynamically updating device software
- and microXML a smaller, faster XML parser supporting SAX and DOM API
eRCP currently support Windows Mobile 2003/5.0, Symbian S60/S80, and QT embedded devices.
After reading the great article Deploying BIRT from Jason Weathersby I decide to create a little example on how to use BIRT RE API with Jakarta Struts framework.
To do so I’ve followed Jason steps:
- Create a WebReport/WEB-INF/lib directory underneath the Tomcat webapps directory.
- Copy all the jars in the birt-runtime-2_1_0/ReportEngine/lib directory from the Report Engine download into your WebReport/WEB-INF/lib directory.
- Next, create a directory named platform in your WEB-INF folder.
- Copy the birt-runtime-2_1_0/Report Engine/plugins and birt-runtime-2_1_0/ReportEngine/configuration directories to the platform directory you just created. In this example the context is WebReport, so the folder structure is /webapps/WebReport/platform/plugins and webapps/WebReport/platform/configuration.
- Additionally, create directories below WebReport for image location and report location.
and used the same directory structure:

The example allows you to generate reports in HTML, PDF, and XLS formats. For the last one I’ve used Tribix XLS Emitter.
To get more information about how to use XLS emitter with BIRT Report Engine API please read the README file that comes with in the binary distribution.
Read the rest of this entry »
Tribix 2.1.0 final - Extended emitters for BIRT (Business Intelligence and Reporting Tools) provides a set of extended emitters for BIRT 2.1.0 final or above.
It comes along with a PPT (MS PowerPoint) emitter preview release. You can now export all your reports made with the BIRT Reporting System to Excel, or even preview them in PowerPoint.
This version does support fixed-column-width sheet output and image export to Excel which are great news since my last post about Reporting Tools.
Here’s a screenshoot:

Problem - You want to use the last Hibernate 3 (Object to Relational Mapping Solution) with a code generation tool that automatically generates your Hibernate descriptor files, and build your project with an advanced build tool like Maven2.
Solution - Use maven2-xdoclet2-plugin.
Maven is a popular open source build tool for enterprise Java projects; it can manage a project’s build, reporting and documentation from a central piece of information (POM file).
XDoclet is an open source code generation engine with the goal of continuous integration. It enables Attribute-Oriented Programming for java. It uses custom JavaDoc-like tags to generate external resource files to support the main Java classes. XDoclet has mainly been used for the auto-generation of EJB descriptors (and related J2EE container technologies).
XDoclet2 is a rewrite of the XDoclet engine. It allows you to use Hibernate 3 features, Java5 language features in your model POJOs, and has substantially better error reporting than XDoclet.
Read the rest of this entry »
JBoss Seam 1.0, an application framework for Java EE 5 based on Asynchronous JavaScript and XML(AJAX), Java Serve Faces(JSF), Enterprise Java Beans(EJB3), and other technologies, has been released.
Read more in JBoss SEAM 1.0: rethinking web application architecture at InfoQ.
The Seam project is proud to announce the release of JBoss Seam 1.0 GA, an application framework for Java EE 5. Seam aims to be the most productive platform for development of enterprise and rich internet applications in any programming language.
Seam integrates Java EE 5 technologies like EJB 3.0, JSF and JMS into a unified programming model and then narrows the semantic gap between the business domain and the Java programming language by deeply integrating technologies like jBPM for business process and user interaction modelling and Drools for management of business rules. Seam Remoting provides an AJAX-based remoting layer for EJB 3.0, allowing client-side JavaScript to call EJB session beans directly. Seam’s unique contextual state management architecture makes it easy to build applications with complex, stateful user interactions and helps eliminate a whole class of bugs endemic to browser-based applications. Seam also eliminates the “XML hell” that plagues Java frameworks designed for use with J2EE by leveraging Java 5 annotations for declarative programming.
Seam 1.0 introduces the following new features:
- Seam Remoting - an AJAX-based remoting layer for EJB 3.0 components and JMS (created by Shane Bryzak)
- Support for JSR-168 compliant portal engines such as JBoss Portal
- Elegant handling of internationalization and JSF messages via EL-based interpolation
- Helper components for JMS senders/publishers
- JSF tag library
- Redesigned XML-based configuration facility
- Support for integrating databinding architectures
- Eventing architecture for loosely-coupled components
- Seam Logging
- JBoss Cache integration for cluster-wide state replication
- Experimental Drools integration
- Compatibility with the Java EE 5 reference implementation
- Much more…
As usual, the best way to learn about Seam is to check out the example applications. Start with the registration, numberguess, booking, blog, dvdstore and chatroom examples.
From In Relation To…