• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to fetch JSP text field value

 
Hrishikesh Maluskar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 = ""/>
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Believe it or not, the Struts 2 documentation actually covers how to handle request parameters.
 
Hrishikesh Maluskar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if you want the benefits provided by the tag.

Without knowing anything else, it'll be impossible to help.
 
Samuel Behrman
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Samuel: What? It's specifically a Struts 2 question, and is in the correct forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic