Hi,

I saw on the Struts page that one of the To Do items is a portlet like
system for struts. My personal experience with struts, both at my employer
SilverStream which promotes and uses Struts a lot and in my free time have
been very successful. However I sometimes mis the ability to construct a gui
component I can insert in a jsp.

This component knows nothing about the page or context it is being
instantiated in, thus enabling a high level of reusability.

Currently I have an experimental library that allows me to write the
following in a jsp:

<component:include
type="org.coderspotting.portal.web.presentation.rdf.RDFComponent">
    <component:attributes>
        <component:attribute name="url"
value="http://www.slashdot.org/slashdot.rdf"/>
</component:attributes>
</component:include>

This works perfectly in Struts 1.0.

The components can render themselves in the current page context using
either a SimpleView, XMLView or a JspView.

SimpleView: the class itself renders the html code, good for quick and dirty
rendering or when there is almost nothing to render (static text for
instance)

XMLView: xml/xsl transformation, the resulting html is rendered
JspView: the rendering process is forwarded to a jsp page
Components can be "nested". So you could have a JspView for a component that
would itself contain another component inclusion.

The purpose of the <component:attribute> tags is to set values on the model
of the component. In this case, the tag would search for a setUrl method on
the model of the component. One of the extentions I am thinking of is using
a scheme similar to <bean:write>.

I would then have code like this:

<component:include
type="org.coderspotting.portal.web.presentation.rdf.RDFComponent">
    <component:attributes>
        <component:attribute name="url" bean="BeanOnAScope"
property="rdf.source"/>
</component:attributes>
</component:include>

In this case, the attribute tag would look for a bean stored on a scope
(optionally a scope attribute could be passed) with the key "BeanOnAScope"
and it would then look for a property with the name "rdf" and recursively on
that value for a property with the name "source". This last "feature"
similar to <bean:write> as mentioned earlier.

This transfer of values into the component's model would not be limited to
simple types like int or string but to any type.

Is there already any work in this area going on? Does this idea sound
interesting?


[The opinions or ideas in the above email are not necessary supported by
SilverStream Software]

Bavo De Ridder
Field Application Engineer
Silverstream Software

tel +32 (2) 474 46 11
fax +32 (2) 474 46 95
email mailto:[EMAIL PROTECTED]
Visit us at http://www.silverstream.com/

      It's all about the golden rule. Who has the gold, makes the rules.


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

Reply via email to