Struts is designed to encourage a MVC-type architecture, and a tag like
this goes against the MVC grain :)

Generally, the type of facts you are exposing here is something that
many people would tend to determined in the Action, and then pass along
to the presentation page, ready for output. The presentation page
shouldn't really care if the users are the same age or a particular age,
but be focussed on what it suppose to be output given the state behind
these facts. 

So the bean might have a property like usersSameAge, where the Action
had already compared user and user2. Or userMiddleAge, where the Action
had already done the math. 

If you'd like to have tag like this hosted somewhere, you might consider
taking a look at the Jakarta Taglibs subprojects. Most of our bean tags
could actually be hosted there, especially now that bean-util is in the
Commons.

It's also important to keep an eye on the JSTL for future trends, which
is also hosted at Taglibs.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


GRENET David wrote:
> 
> Hi everybody,
> 
> I just subscribed the list, so please excuse me if what I'm writing has already been 
>discussed.
> Using struts, I felt the need for a "bean:write"-like tag that could display not 
>only properties but the result of any method call (with its parameters and all). 
>Where 'bean:write' would allow  :
> <bean:write name="user" property="fullName"/> instead of 
><%=myUserBean.getFullName()%>
> ,the 'bean:write'-like tag would allow :
> <bean:writeMethod name="user" method="isSameAge(user2)"/>  or <bean:writeMethod 
>name="user" method="isAge(42)"/> instead of 
><%=myUserBean.isSameAge(myOtherUserBean)%> or <%=myUserBean.isAge(42)%>
> 
> Thus, I made a very simple version of such a tag where you can give as parameter  : 
>struts-beans (=belonging to one of the 'scope' collections), strings and numbers. My 
>question is : do you plan to have such a tag in a future release ? Do you already 
>have it ? Or is the method call idea just not what beans are for ?
> 
> Thanks for your answer(s).
> 
> David

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

Reply via email to