wood burning stoves 2.0*
The moose likes Struts and the fly likes how to fetch JSP text field value 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 "how to fetch JSP text field value" Watch "how to fetch JSP text field value" New topic
Author

how to fetch JSP text field value

Hrishikesh Maluskar
Ranch Hand

Joined: Jun 19, 2008
Posts: 115
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

Believe it or not, the Struts 2 documentation actually covers how to handle request parameters.
Hrishikesh Maluskar
Ranch Hand

Joined: Jun 19, 2008
Posts: 115
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

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

@Samuel: What? It's specifically a Struts 2 question, and is in the correct forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to fetch JSP text field value
 
Similar Threads
creating textbox
Multiple html:options
how to fetch values from message bean
How to pass the output of one class from one machine to another class in a different machine
passing hidden field in jsp