You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zoran Avtarovski <zo...@sparecreative.com> on 2009/12/10 03:10:29 UTC

S1 Quirk with html tag

Yesterday I had to go back and update some changes to struts 1 app we
developed and are maintaining.

It¹s been a while since I¹ve done any struts1 work but it was urgent and
resources are thin in the lead up to xmas.

Anyway, my question is that I have two identical forms with identical
configuration, but one works fine if the form elements don¹t have a name
attribute and the other doesn¹t.To illustrate one form works with the
following tag:

<html:text property="title"/>

But the second form only works when a name attribute is included:

<html:text name="galleryForm" property="title"/>

I¹d appreciate any insight into why this happens, as it caused me about 8
hours extra work, frustration and a little less hair leading up to the
holidays.

Z.

Re: S1 Quirk with html tag

Posted by Paul Benedict <pb...@apache.org>.
Zoran,

> Anyway, my question is that I have two identical forms with identical
> configuration, but one works fine if the form elements don¹t have a name
> attribute and the other doesn¹t.To illustrate one form works with the
> following tag:
> <html:text property="title"/>

This retrieves the property "title" off the Struts form bean.

> But the second form only works when a name attribute is included:
> <html:text name="galleryForm" property="title"/>

This retrieves the property "title" off the bean named "galleryForm".
The default (without @name) is the Struts form bean.

For future reference, add this to your toolbox:
http://struts.apache.org/1.x/struts-taglib/tlddoc/html/tld-summary.html

Paul

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