You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Frank W. Zammetti" <fz...@omnytex.com> on 2005/09/14 16:47:57 UTC
Re: How to replace normal html-from through html:form in Struts?
Example
On Wed, September 14, 2005 10:15 am, Tamas Szabo said:
> 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 ...
You could make that argument :)
> 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 ... :-)
That's why you want to use the field in Globals... if the key under which
the mapping will be found is changed, your code doesn't need to change.
If you use the value as it currently is today as you show above, you'll
need to change that it someone changes the key down the road. That's the
whole point of that Globals class.
> A tag would be handy for this ...
Pretty trivial... go for it :)
> Tamas
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to replace normal html-from through html:form in Struts?
Example
Posted by Laurie Harper <la...@holoweb.net>.
Frank W. Zammetti wrote:
>>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 ... :-)
>
> That's why you want to use the field in Globals... if the key under which
> the mapping will be found is changed, your code doesn't need to change.
> If you use the value as it currently is today as you show above, you'll
> need to change that it someone changes the key down the road. That's the
> whole point of that Globals class.
I think it's pretty safe to say it *wont* change, though, since not just
the field but also its value are part of the public API, and Struts *is*
very good about maintaining backwards compatibility, after all :-)
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org