You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pa...@yahoo.com> on 2006/08/20 10:45:21 UTC

1.3 set-property key

The key attribute of set-property reads:

    Since Struts 1.3, an alternate syntax is supported.  By using
    the "key" attribute instead of the "property" attribute, you can set 
    arbitrary string properties on the Config object which is populated
    based on the containing element.   NOTE: the "key" attribute is NOT
    supported for <set-property> inside a <plug-in> element.

I might be glossing over a difference here, but how is this "alternative syntax" better or different than the "property" attribute? It highlights the "arbitrary string properties" feature, but I don't have problems with "property" for the same thing.

Paul

 			
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

Re: 1.3 set-property key

Posted by Joe Germuska <Jo...@Germuska.com>.
At 9:59 AM -0700 8/20/06, Paul Benedict wrote:
>So it's just a map of properties?

yep.  So I guess you lose type conversion, if you 
were using non-string bean properties in 
subclasses of the config objects.  Otherwise, I 
think it simplifies things considerably.

Joe


>Joe Germuska <Jo...@Germuska.com> wrote: At 1:45 
>AM -0700 8/20/06, Paul Benedict wrote:
>>The key attribute of set-property reads:
>>
>>      Since Struts 1.3, an alternate syntax is supported.  By using
>>      the "key" attribute instead of the "property" attribute, you can set
>>      arbitrary string properties on the Config object which is populated
>>      based on the containing element.   NOTE: the "key" attribute is NOT
>>      supported for  inside a
>  element.
>>
>>I might be glossing over a difference here, but
>>how is this "alternative syntax" better or
>>different than the "property" attribute? It
>>highlights the "arbitrary string properties"
>>feature, but I don't have problems with
>>"property" for the same thing.
>
>This is not simply alternative syntax.  It is an
>alternative method for handling configuration.
>Before "arbitrary string properties," one was
>obliged to subclass the config object and add
>JavaBean properties with setters and getters.
>This led to a fair amount of boring code and
>configuration, including trivial subclasses,
>extra lines in struts-config.xml to specify the
>config object subclass, casts in Action classes
>when trying to read these values...
>
>The addition of a "properties" object to all of
>the config objects reduces all of that clutter.
>It also makes it more plausible, in my mind, to
>have Struts itself accept configuration with a
>little less "commitment" - for example, the
>ComposableRequestProcessor allows for an
>alternative implementation of ActionContext to be
>specified using an "arbitrary property"
>(ACTION_CONTEXT_CLASS).  Since this area is still
>possibly subject to change/improvement, I find
>this more palatable than changing the
>ControllerConfig class and the DTD to have this
>provided as a bean property of ControllerConfig.
>
>Hope that helps to clarify things a little bit.
>
>Joe
>
>
>--
>Joe Germuska
>Joe@Germuska.com * http://blog.germuska.com
>
>"The truth is that we learned from João forever to be out of tune."
>  -- Caetano Veloso
>
>
>
>
>---------------------------------
>Stay in the know. Pulse on the new Yahoo.com.  Check it out.


-- 
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com    

"The truth is that we learned from João forever to be out of tune."
	-- Caetano Veloso

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


Re: 1.3 set-property key

Posted by Paul Benedict <pa...@yahoo.com>.
So it's just a map of properties?

Joe Germuska <Jo...@Germuska.com> wrote: At 1:45 AM -0700 8/20/06, Paul Benedict wrote:
>The key attribute of set-property reads:
>
>     Since Struts 1.3, an alternate syntax is supported.  By using
>     the "key" attribute instead of the "property" attribute, you can set
>     arbitrary string properties on the Config object which is populated
>     based on the containing element.   NOTE: the "key" attribute is NOT
>     supported for  inside a 
 element.
>
>I might be glossing over a difference here, but 
>how is this "alternative syntax" better or 
>different than the "property" attribute? It 
>highlights the "arbitrary string properties" 
>feature, but I don't have problems with 
>"property" for the same thing.

This is not simply alternative syntax.  It is an 
alternative method for handling configuration. 
Before "arbitrary string properties," one was 
obliged to subclass the config object and add 
JavaBean properties with setters and getters. 
This led to a fair amount of boring code and 
configuration, including trivial subclasses, 
extra lines in struts-config.xml to specify the 
config object subclass, casts in Action classes 
when trying to read these values...

The addition of a "properties" object to all of 
the config objects reduces all of that clutter. 
It also makes it more plausible, in my mind, to 
have Struts itself accept configuration with a 
little less "commitment" - for example, the 
ComposableRequestProcessor allows for an 
alternative implementation of ActionContext to be 
specified using an "arbitrary property" 
(ACTION_CONTEXT_CLASS).  Since this area is still 
possibly subject to change/improvement, I find 
this more palatable than changing the 
ControllerConfig class and the DTD to have this 
provided as a bean property of ControllerConfig.

Hope that helps to clarify things a little bit.

Joe


--
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com

"The truth is that we learned from João forever to be out of tune."
 -- Caetano Veloso



 		
---------------------------------
Stay in the know. Pulse on the new Yahoo.com.  Check it out. 

Re: 1.3 set-property key

Posted by Joe Germuska <Jo...@Germuska.com>.
At 1:45 AM -0700 8/20/06, Paul Benedict wrote:
>The key attribute of set-property reads:
>
>     Since Struts 1.3, an alternate syntax is supported.  By using
>     the "key" attribute instead of the "property" attribute, you can set
>     arbitrary string properties on the Config object which is populated
>     based on the containing element.   NOTE: the "key" attribute is NOT
>     supported for <set-property> inside a <plug-in> element.
>
>I might be glossing over a difference here, but 
>how is this "alternative syntax" better or 
>different than the "property" attribute? It 
>highlights the "arbitrary string properties" 
>feature, but I don't have problems with 
>"property" for the same thing.

This is not simply alternative syntax.  It is an 
alternative method for handling configuration. 
Before "arbitrary string properties," one was 
obliged to subclass the config object and add 
JavaBean properties with setters and getters. 
This led to a fair amount of boring code and 
configuration, including trivial subclasses, 
extra lines in struts-config.xml to specify the 
config object subclass, casts in Action classes 
when trying to read these values...

The addition of a "properties" object to all of 
the config objects reduces all of that clutter. 
It also makes it more plausible, in my mind, to 
have Struts itself accept configuration with a 
little less "commitment" - for example, the 
ComposableRequestProcessor allows for an 
alternative implementation of ActionContext to be 
specified using an "arbitrary property" 
(ACTION_CONTEXT_CLASS).  Since this area is still 
possibly subject to change/improvement, I find 
this more palatable than changing the 
ControllerConfig class and the DTD to have this 
provided as a bean property of ControllerConfig.

Hope that helps to clarify things a little bit.

Joe


-- 
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com    

"The truth is that we learned from João forever to be out of tune."
	-- Caetano Veloso

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