This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Regarding the Struts UI Tags of using   <s:textfield Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Regarding the Struts UI Tags of using   <s:textfield" Watch "Regarding the Struts UI Tags of using   <s:textfield" New topic
Author

Regarding the Struts UI Tags of using <s:textfield

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528


<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??


If you want something you never had do something which you had never done
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 30, 2009
Posts: 528
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

Joined: Sep 29, 2008
Posts: 12617

Yes.
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Thanks a lot David.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regarding the Struts UI Tags of using <s:textfield
 
Similar Threads
javax.el.PropertyNotFoundException: Property 'empname' not found on type java.lang.String
how to fetch JSP text field value
tomcat jsp question to ask
s:property tag values in action side
Could not read mappings from resource ?