Author
how to fetch JSP text field value
Hrishikesh Maluskar
Ranch Hand
Joined: Jun 19, 2008
Posts: 114
how to fetch this value in execute method of my class file in strurs2
<input type = "text" name = "lastName" title = "Last Name" class = "TextBox_Border " id = "" size = 15 style = "WIDTH: 150px" value = ""/>
SCJP 1.5
www.licexpadvice.com
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Oct 23, 2009 07:13:19
0
Believe it or not, the Struts 2 documentation actually covers how to handle request parameters.
Hrishikesh Maluskar
Ranch Hand
Joined: Jun 19, 2008
Posts: 114
its displaying the lastName as null. Is it necessary to use s:textfield as in
<s:textfield name="lastName" label="Last Name"/>
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Oct 23, 2009 09:24:27
0
Only if you want the benefits provided by the tag.
Without knowing anything else, it'll be impossible to help.
Samuel Behrman
Ranch Hand
Joined: Oct 02, 2009
Posts: 49
Get the value AFTER you submit it? That would be a server-side question. Since you mention Java, I suggest you ask in the Java forum. All values are packaged in the RESPONSE object, but that object is exposed in different ways in different languages.
RAQ Report : Web-based Excel-like Java reporting tool.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Oct 25, 2009 08:16:10
0
@Samuel: What? It's specifically a Struts 2 question, and is in the correct forum.
subject: how to fetch JSP text field value