Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • 1.3 set-property key

    1 answers - 752 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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. NTE: the "key" attribute is NT
    supported for <set-propertyinside a <plug-inelement.
    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.
  • No.1 | | 1986 bytes | |

    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. NTE: the "key" attribute is NT
    supported for <set-propertyinside a <plug-inelement.
    >
    >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"
    (ACTIN_CNTEXT_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

Re: 1.3 set-property key


max 4000 letters.
Your nickname that display:
In order to stop the spam: 4 + 3 =
QUESTION ON "Java"

EMSDN.COM