I think bean:define has a gap in its functionality which needs to be filled.

PROBLEM/GAP:
With bean:define I can define a String on a context as below which is not
possible with jsp:useBean.  jsp:useBean requires the String to be part of
another JavaBean (both name and property are required).

<bean:define id="foo" value="bar"/>

But now if I want to modify the value of "foo" to be "frodo" in the same JSP
page, I cannot use bean:define again (see USAGE NOTE at
http://jakarta.apache.org/struts/struts-bean.html#define).  I cannot use
jsp:setProperty either because I cannot refer to the "foo" with a "name" and
"property" combination.

PROPOSED SOLUTION:
If bean:define allowed a "mustCreate" attribute (default value would be
"true" for backward compatibility) it could be set to "false" in such cases
thereby telling the DefineTei to not export the "foo" variable while the
DefineTag can still set/modify the value.

I know that a single line of Java scriptlet can be used to achieve this but
I am trying to avoid that by exclusively using tags.

I am posting it on the user's list first for a sanity check.  If there are
no counter-arguments, I will post it to the dev list and/or submit a patch.

Thanks,

Mitesh Mehta
S1 Corp (http://www.s1.com) 

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

Reply via email to