I have quite a lot of experience with S2 and JSF which I'd like to share.  
Although on many levels the technologies are different, we have managed to make 
them work together with profound benefits to each.  

First a caveat:  our use of JSF as served from S2 is in a limited fashion.  
There are things we haven't tried because we haven't needed them.  There may be 
things which wouldn't work with this technique.  Our use is primarily as a 
reporting engine.  We use S2 to manage all the 'control' functions of the MVC 
cycle.  There are no beans or navigation rules in the faces-config file.  We 
have produced a clear separation of the Model functionality from the Struts 
functions, with Struts merely retrieving the model objects and placing them 
into Session storage.  Then the model objects are queried from a JSP page, 
which causes the model to 'export' itself to JSF components.  The model 
components have zero getters/setters, except a method 'getData()' which 
triggers the export process, and returns a jsf 'UIComponent'.  The export 
process consists of creating the JSF 'UIComponent' in code, very similarly to 
the way you'd make pages in Swing (assuming that you are not using a totally 
lame graphic page generator).  Then the completed component is rendered by a 
single jsf tag on the page.  Any submittals, which in JSF are to some funky 
url, are redirected by javascript to the correct S2 url.  This was the main 
problem until we figured out how to fix it.

When I started designing the app I envisioned using standard JSP functionality 
to produce the pages, including the use of the S2 tags.  However I really hated 
the S2 tags (I still believe that they are somewhat below horrible in the 
panoply of functionality).  A co-worker suggested working around this with JSF, 
and as a result the app is much stronger than I ever envisioned.

The app does not use the struts-jsf plugin, and also uses tiles, again not 
using the struts-tiles plugin.  We have found that the use of these plugins is 
really limiting, and we are much better off with independent installations of 
both these functions in our app.  It would be nice to have a good struts-jsf 
function, but my impression is that there is not much being done with the 
plugin lately (I could be wrong, of course).  As it works out, the 
configuration of all the services is quite demanding, but perfectly 
straightforward once you have figured things out.

In short, we have had excellent results with JSF with S2.  We use the JSF 
components from Trinidad, and they are first rate - with built in table 
sorting, paging, etc all using Ajax behind the scenes.  S2 is a superior 
'Control' component, but not really great at 'View'.  With the proper approach, 
they are perfectly compatible.  (Too bad Shale seems moribund).

- Ray Clough
[EMAIL PROTECTED]

> ----- Original Message -----
> From: "Dave Newton" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Subject: Re: [friday] Re: Struts2 vs JSF
> Date: Fri, 29 Feb 2008 14:24:26 -0800 (PST)
> 
> 
> --- Musachy Barroso <[EMAIL PROTECTED]> wrote:
> > Search for "Snatch fight" in youtube, and you will get a felling of
> > what Struts 2 would do to JSF in a fight :)
> 
> I was *really* scared to see what that would bring up ("snatch", in the US,
> is a somewhat derogatory term for... uh... female parts).
> 
> Turns out it was just a scene from the movie "Snatch", so it was all okay.
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

>



- Ray Clough
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to