• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I extract a value of a textfield.

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah, it's struts.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, this is the JSF forum. Moving to the Struts forum...
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic