• 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 to set value in html:text

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I am new to struts.I would like to set value into <html:text > in my next struts jsp page. But i don't know how to set it? Can anybody to say how to set this?

<bean:write name="staffForm" property="staffid"/>

<html:text property="staffid" value="" />

My actual fact is one sequence number is generated when i am creating new user . i can set that number into <html:text> in my new user creating page.pls help me.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not quite clear how your page works...is it part of a wizard-like interface? The simple answer is that html:text will show what ever value is in the corresponding property of the form. That means that you just need to set the desired value on the form. This is generally done in the action that displays the page (are you using an action to display the page?).

- Brent

P.S. One of the admins will probably be along shortly to remind you to update your name to match the sites policy (valid first and last name).
 
Gopnan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sterling,

In id is the value fetch from database. I set that id value to my form field like (sf.setStaffid(id)). That id value will be display to my next jsp page when i was click registration form. I get id value from database and i set that value in to form field in Action class. But i don't know how can i show that value in my next jsp page textbox.

sf--> StaffForm object
staffid --> String variable
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nanda,

Please change your publicly displayed name so that it conforms to the JavaRanch Naming Policy. You can do so by clicking on the my profile link.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing you want to do (right after you change your site name) is to get rid of the value="" part from your html:text tag. That tells the form to always show empty instead of being populated from the value in the form.

- Brent
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gopnan,

Thanks for taking the time to change your displayed name. However, you're not quite there yet. The naming policy requires a first and last name that is not obviously fictitious. Please change it again so that it complies with the policy.

Thanks,

Merrill
[ September 28, 2007: Message edited by: Merrill Higginson ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic