The Stripes framework

Choosing a java web framework is somehow a complex process, not because they are difficult to evaluate but because there are so many of them (in fact it seems that there are more java frameworks than java developers :) but having many frameworks is a good thing. It means that there is a lot of competition and the competition seems to be healthy since most of the frameworks are open source, so competition is based on quality and features instead of marketing and lobbing.

Different people have different criteria on selecting a framework and probably different needs, so I will list my criteria an the reasoning behind them for choosing Stripes.
(Disclaimer: this expresses only my views on what I expect from a framework, I don’t think there are good or bad frameworks, from my point of view there are only convenient frameworks – just trying to avoid flame war here, although flame wars entertains me a lot!).

I would like to start with what I consider the most annoying thing when working with a Java framework which is not other than XML configuration files. Having worked with JSF and Struts where you need to configure all your managed-beans/action-beans and pretty much everything else into an xml configuration file, which during development becomes a mess to keep it in sync, I enjoy that Stripes removes all this configuration hassle with autoloading feature. The only xml configuration file that you need is the web.xml but that is required by the Servlet specification. Configuration by exception (a.k.a convention over configuration) is the way to go, developers should focus on business solutions and not in framework configuration details that will just disturb the flow of thinking. Hopefully other framework will follow – or maybe some already does.

Testing is the most important part of development and therefore frameworks should come with a build-in support for testing to make this process easy. So Stripes comes with a set of mock objects that help developers to easily write unit tests.

Easy extension and customization. Stripes is designed in modular form it is quite easy to add a customization plugin to change the behavior of any part of the framework, because of this modular design the extensibility of Stripes is trivial. Actually This is one of the areas that the framework really make the difference.

I don’t think that there’s a need to explain why internationalization of web application is important, all frameworks need to have a built-in support for i18n. Stripes tags comes with a default bundle lookup strategy so that i18n is just a mutter of adding key/value pairs in the resource bundle.

Never trust the user input, therefore a strong and flexible validation mechanism is needed. Stripes provides a powerful validation mechanism which is based on annotations (remember there is no XML configuration).

When working with request parameters the most annoying process is converting Strings to objects and vise versa, the Stripes support for this process is just amazing. But it is not just conversion there is also support for formating an object to string and that’s as easy as the conversion process.

Stripes comes with a built in support for layouts, with three tags you can achieve pretty much everything. If the built in support for templating is not enough you can use freemarker.

Since we are talking about web framework and web applications it would be a pity to not take advantage of Ajax. Any Ajax framework can be used due to Stripes simple and transparent request/response nature.

These are some of the features that I like to see in a framework and surely you can find this features in most frameworks and probably more but the difference is that with Stripes is easy and development is fun again as the book of Frederic Daoud suggests and proves it.

If you want to learn Stripes I suggest the “Stripes … and Java web development is fun again” from The Pragmatic Programmers, in fact this is the only book about Stripes but even if there were more books I am totally sure that I would suggest this book again, it is very well written and it covers everything about Stripes.

The following is a quick list of Stripes features, which I will try to explain and give an example in future post for each one of them and link them back to this page:

URL Binding
Built in Validation
Custom Validation
Type Conversion
Using Freemarker
Exception Handling
URL Customization
Ajax Integration
Framework Extension
Framework Customization
Dependency Injection (Giuce/Spring)
JPA Integration
Security and Encryption

The examples will be deployed on google app engine.

P.S: Now that the jsr 330 is approved maybe the next version of Stripes will come with build in Dependency Injection.

If you would like to start playing with Stripes and google app engine have a look at the following links:

Stripes resources:
Stripes Home Page
Stripes … and Java development is fun again


5 thoughts on “The Stripes framework

  1. hello Freddy,

    well… I think we should thank you for the great job you have done with Stripes and the Book.
    Unfortunately I discovered Stripes only this summer and I am really surprised that it’s not mainstream.
    From now on it will be the framework of my choice :) and maybe I can find the time to also contribute!


  2. The Problem is that you not have a clue of the power of JSF… JSF has annotations! (see: Shale and JSF 2.0)

    Stripes is the biggest bullshit! last update in 2009 -> now we have 2010!!!!!! Nothing happen. No support! Nothing!
    JSF: More then 20 Project, 100 of sites, IBM, SUN, Apache supported jsf who support stripes????

    No Ajax, No Scopes, some tags, that its. and a fucking ActionBean implementation….

    In JSF a have like in richfaces more then 100 ajax enabled components, differents scopes for the controllers, a ejb interegration (seam), a navigation-model, a lifecycle-handling, etc….

    P don’t post so stupid things in the www – other people might think that stripes is a good UI-Framework

    • Dude I am very sorry about you, first that in 2010 you are still stuck with jsf :) and secondly that you think you can tell people what their opinion should be or whether they should write it, it’s a personal blog if you didn’t notice, unless you do not know the meaning of a personal blog, but I can ensure you that most people are smart enough to not confuse it.

      Regarding Stripes, to late, small community didn’t catch, shit happens. But if you know reading, you will see that there is ajax, scopes, validation and more. and the post is actually from 2009 (again has to do with reading)

      By the way SUN does not exists anymore, and apache also support struts, tapestry, wicket, well the list is big so it does not mean anything…

      Well Mr. JSFPRO (it’s a self assigned title I suppose) I was actually unlucky enough to experience the the power of jsf, and since you mentioned 2010, have a look at what is used in 2010 (just a small list: Grails, python Django, Scalla lift, Roo, GWT, Play)

      If you are unable to learn anything else, well I am sorry about that too :)

    • The problem is that JSF is the most overcomplicated underachieving piece of shit framework in existence, and JSF 2.0 is just where every other framework worth its salt was in 2005. Still a lot of catching up to do.

      I’m glad you are happy using JSF. You are clueless, and that is less competition for us who deliver working web applications on time and within budget.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s