incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Jaquith <>
Subject Re: Fear of the Unknown [Was: Resolved: (JSPWIKI-156) Allow customisation of CommandResolver]
Date Fri, 25 Jan 2008 00:03:04 GMT

Re: Stripes. My early builds aren't particularly beastly. :)  There  
are some things about the fact that ActionBeans merely *exist* that do  
force some additional issues, though, like for instance, do we turn  
WikiContext into an interface? (Answer: probably yes...) But this has  
nothing to do with Stripes per se.

In a nutshell, ActionBeans unify what the user sees and does on a page  
(or portion of a page) into a single class. The key thing to know  
about ActionBeans is that they include both fields that are filled by  
HTML form parameters (getters/setters) and activities (methods) that  
happen when users do something (like a form POST). For example  
(hypothetically): EditActionBean might contain getPageText() and  
setPageText(String), which contains what the user's editing. Methods  
that do things might be save(), cancel(), preview().

Stripes also includes all of the scaffolding to do the things  
developers do all the time: parse form fields, convert form strings to  
other types,  validate input, handle redirections, etc. Basically,  
Stripes means that JSP developers won't have to do all sorts of crazy  
parameter parsing to extract the user's supplied values. And it means  
that the business logic can be neatly encapsulated into sensibly-named  

What's extra nice about Stripes is that it follows a "convention  
rather than configuration" philosophy. Example: if your ActionBean has  
a getter/setter pair getFoo/setFoo, then it knows that your form field  
is probably called "foo" (although you can tell change this assumption  
through very simple method annotations if you want). So, you don't  
need to set up lots of complex config files (like with Struts).

The fastest way to grok Stripes is to read, carefully, (and maybe  
twice) their "my first Stripe" example:

More of this will become clearer with some JSPWiki-specific examples,  
which I'll start checking in after we get a 3.0 branch set up.


On Jan 24, 2008, at 11:04 PM, Janne Jalkanen wrote:

>> I'm just hoping we aren't purchasing cool at the expense of  
>> simplicity.
>> I really like simplicity -- it was certainly one of the reasons I  
>> chose
>> JSPWiki over something like ZWiki. Whatever benefits Stripes may  
>> have it
>> looks to significantly increase the internal complexity of JSPWiki,  
>> or
>> it looks that way anyway...
> Nope.  I agree the Stripes documentation can be a bit daunting, but  
> Stripes *is* going to make things easier (compared to the current  
> Command structure anyway, which, in retrospect was a mistake, I  
> think).
> That is, unless Andrew has managed to turn it into some monstrous  
> beast.  But that would take a bit of an effort.  The best way, I  
> guess, to learn about Stripes would be just to poke around - I built  
> a sample project with it, and it really is quite easy.  It has a  
> couple of quirks (like whether you choose an ActionBean or a JSP as  
> your first-stop -- the documentation says one thing and the mailing  
> lists say the other thing), but it really uses things like  
> Annotations to their full potential.
> /Janne

View raw message