>
> I would say that the code that is yielded when you reference the form by
> name is clearer and thus better regardless and I would throw away the
> possibility of someone changing the name in the config file. It's more
> important that the code be as explicit IMO.
I definitely like clean code and if I'm looking at the generated HTML
I agree that it is cleaner if you reference the form by name.
But in the JSP it's just doesn't seem right to reference a form
name that will appear only in the generated HTML, based on a config
file value.
It just doesn't seem clean ...
> Isn't there a struts tag which for a given action path it gives me the
> > name of the associated form?
>
> You mean the associated ActionForm? I don't think there is a tag to so
> that specifically, but you can get at that information by doing:
>
> <% ActionConfig mapping = (ActionConfig)request.getAttribute(
> Globals.MAPPING_KEY); %>
If I don't want to use scripting I guess I could use something like
${requestScope['org.apache.struts.action.mapping.instance'].name}
But what if the Globals.MAPPING_KEY will change ... :-)
A tag would be handy for this ...
Tamas