Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding the Struts UI Tags of using <s:textfield

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


<s:textfield label="Employee Name" name="empname" size="15" maxlength="10" />

I am into basics of the Struts2 version.

Can anybody please take time and tell me what is name attribute (name="empname") means here??
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the "name" attribute of the emitted HTML input field, hence the form parameter that will be submitted, and the name of the action property that will be filled with the form value.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David.

What is understood with respect to name="empname" is that there will be a Action class and it will consist of the empname as a property with its getter and setter methods .

Am i correct??
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot David.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic