Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I extract a value of a textfield.

 
Fritz Largosa
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to output the value of the textfield below.

--------------------textfield code-------------------------
<html:text styleClass="textfield" name = "user" property="username" value = "original" style="width:200px" styleId="usernameTextEdit"/>

------------extraction code which does not work- help!----------
out.println("value = " + request.getParameter("user"));


--------problem----------
I do not know how to extract the value off the textfield.
[ December 08, 2005: Message edited by: Fritz Largosa ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't look like JSF to me. Struts maybe? What technology are we dealing with here?
 
Fritz Largosa
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, it's struts.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, this is the JSF forum. Moving to the Struts forum...
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case, since you have specified "original" as the value attribute in your html:text tag, the value of this field will always display as "original". If you remove this value attribute, the value of the field will be ((User)request.getAttribute("user")).getUserName(). This is assuming that "User" is the class name of the bean referred to as "user" as the name attribute of the html:text tag.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic