There is already a single parameter element to an ActionMapping,
although it is probably underused.
<
http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionMapping.html
>
I was just suggesting that we treat it like a real HTTP-style parameter,
but using XML syntax seems like a better idea ;-)
archive wrote:
>
> Ted,
>
> are you talking about having the possibility of adding a "parameter" element
> to the action element ?
>
> <action ...>
> <parameter name="param1" value="value1" />
> <parameter name="param2" value="value2" />
> <forward .../>
> <forward .../>
> </action>
>
> and access a parameter value via a getParameter("param1") of the Mapping
> instance ?
>
> I think this would offer great possibilities, including deployment
> configuration of an Action. Also, one single parameter attributes lacks the
> description of its goal and ends up being used inexplicitly for many
> different tasks. For example, the use of TemplateMethod pattern in the
> DispatchAction implementation: wouldn't it be a bit clearer if
> DispatchAction used a <parameter name="alternatePerformMethodParameter"
> value="method" /> instead of the inexplicit parameter="method" ?
>
> jm2c
>
> nicolas b.
>
> -----Original Message-----
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 05, 2001 1:19 PM
> To: [EMAIL PROTECTED]
> Subject: Parameter property
>
> Does anyone have any strong feelings about the ActionMapping parameter
> property?
>
> This was introduced late in the 1.0 timeframe, to support the
> DispatchAction I believe.
>
> <
> http://jakarta.apache.org/struts/api/org/apache/struts/actions/DispatchActio
> n.html
> >
>
> It's documented as a "General purpose configuration parameter that can
> be used to pass extra information to the Action selected by this
> ActionMapping." In the context of DispatchAction, it's used to determine
> which parameter indicates the name of the alternate perform().
>
> I've been using it as a way to for the Action to tell which mapping was
> used. While you could do almost the same thing with getPath(), I'd
> rather not bind naming conventions to functionality.
>
> I'm thinking of adding more funcationality to parameter, so developers
> could add more information to the mapping, and perhaps get more mileage
> out of a given Action. My initial idea is to add getParameterValues()
> and getParameterNames() methods to ActionMapping, and treat parameter
> like a regular HttpServletRequest query string.
>
> The parameter property makes a big difference in the way I design my
> mappings and Actions, and I'd like to promote its use as standard way to
> put more information into a mapping.
>
> Thoughts?
>
> -Ted.