struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Reusable Components
Date Wed, 09 Jul 2003 23:33:49 GMT


On Wed, 9 Jul 2003, Adam Hardy wrote:

> Date: Wed, 09 Jul 2003 22:48:26 +0200
> From: Adam Hardy <ahardy.struts@cyberspaceroad.com>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> Subject: Re: Reusable Components
>
> JavaServer Faces sounds like Tiles, Dynamic Forms and Validator rolled
> into one - or does that miss the point?

Sort of, since JavaServer Faces doesn't directly have an analog for Tiles
or the Validator Framework (although it does support per-component
validations).

Struts does not really have any notion of a UI component that maintains
its own state, or can have child components so that you can build complex
things out of simple things.  The closest analog is an individual property
in a form bean (where Struts promises to save and restore state for you,
and the HTML tags promise to render for you.  The JavaServer Faces
approach to these sorts of issues is substantially more powerful than what
Struts offers -- the smallest difference being that we wouldn't need form
beans at all if Struts were built on top of Faces.

As I've said before, it's feasible for Struts folks to treat Faces simply
as a replacement for the HTML tags, simply to get access to the richer
rendering model and complex components, while continuing to use Struts
features (tiles, validator, actions, ...).  There's an integration library
already available that can do that for you:

  http://jakarta.apache.org/builds/jakarta-struts/release/struts-faces/

The proof of concept was to take the standard struts-example.war sources,
and convert the JSP pages (one page at a time) to use Faces tags instead,
without touching the back-end actions.

However, if you start from scratch with JavaServer Faces, you can achieve
lots of the same separation between business logic and presentation logic
that we're all familiar with.  It's worth a look so you can start thinking
about if and how to integrate this kind of thing into your own apps once
it goes final (later this year).

Craig




>
> Craig R. McClanahan wrote:
> >
> > On Wed, 9 Jul 2003, Frédéric Dreier wrote:
> >
> >
> >>Date: Wed, 9 Jul 2003 10:13:02 +0200
> >>From: Frédéric Dreier <frederic.dreier@uptime.ch>
> >>Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>,
> >>     frederic.dreier@uptime.ch
> >>To: struts user <struts-user@jakarta.apache.org>
> >>Subject: Reusable Components
> >>
> >>Hi,
> >>
> >>I really need your help and hints... I was not able to found something
> >>related on internet.
> >>
> >>how can i make reusable 'high-level' components? taglib seems to be useless
> >>for such components (that already use JSP's and actions). Tiles is exactly
> >>what i need but it does not seems to work if sub-component JSPs are packed
> >>in a JAR library..
> >>
> >>Does anyone has some link or other resources about it? or even has another
> >>solution?
> >>
> >
> >
> > Reusable user interface components is what JavaServer Faces is all about,
> > and it can be used with Struts:
> >
> >   http://java.sun.com/j2ee/javaserverfaces/
> >
> > One of the features is exactly what you're asking for -- the ability to
> > package up components, renderers, and the corresponding tags into a JAR
> > file that auto-configures itself when you drop it into /WEB-INF/lib.
> >
> >
> >>Thanks in advance,
> >>
> >>Frederic
> >
> >
> > Craig
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message