You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yu Baofeng <bf...@censoft.com.cn> on 2003/07/11 03:04:29 UTC

答复: Reusable Components

maybe portlet is better!

-----邮件原件-----
发件人: Craig R. McClanahan [mailto:craigmcc@apache.org] 
发送时间: 2003年7月10日 7:34
收件人: Struts Users Mailing List
主题: Re: Reusable Components




On Wed, 9 Jul 2003, Adam Hardy wrote:

> Date: Wed, 09 Jul 2003 22:48:26 +0200
> From: Adam Hardy <ah...@cyberspaceroad.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@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 <fr...@uptime.ch>
> >>Reply-To: Struts Users Mailing List
<st...@jakarta.apache.org>,
> >>     frederic.dreier@uptime.ch
> >>To: struts user <st...@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





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


Re: 答复: Reusable Components

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 11 Jul 2003, Yu Baofeng wrote:

> Date: Fri, 11 Jul 2003 09:04:29 +0800
> From: Yu Baofeng <bf...@censoft.com.cn>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: 'Struts Users Mailing List' <st...@jakarta.apache.org>
> Subject: [gb2312] 答复: Reusable Components
>
> maybe portlet is better!

Better for what?  If you're talking about the Portlet API (being developed
under JSR-168), that only defines an API between the portal server and the
portlet ... it says nothing about what a portal server does to aggregate
the output and produce the resulting page.

For what it's worth, onf of the changes made in the most recent EA release
of JavaServer Faces was to remove direct dependency on javax.servlet.*
APIs.  This was deliberately done so that JavaServer Faces components can
be used inside either portlets or servlets (and therefore JSP pages).

This is something I think we'll need to do in Struts as well, so that
Actions can be used directly from a portlet.  Right now, that is a little
bit awkward.

Craig


>
> -----邮件原件-----
> 发件人: Craig R. McClanahan [mailto:craigmcc@apache.org]
> 发送时间: 2003年7月10日 7:34
> 收件人: Struts Users Mailing List
> 主题: Re: Reusable Components
>
>
>
>
> On Wed, 9 Jul 2003, Adam Hardy wrote:
>
> > Date: Wed, 09 Jul 2003 22:48:26 +0200
> > From: Adam Hardy <ah...@cyberspaceroad.com>
> > Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> > To: Struts Users Mailing List <st...@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 <fr...@uptime.ch>
> > >>Reply-To: Struts Users Mailing List
> <st...@jakarta.apache.org>,
> > >>     frederic.dreier@uptime.ch
> > >>To: struts user <st...@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
>
>
>
>
>
> ---------------------------------------------------------------------
> 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