• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Populating form with String not bean

 
Wes Hughes
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to popualate a form with a users email, which is obtained from the database. In my Action I set where email is a String. In my jsp I do the following
Unfortunately, this doesn't work, nevermind the fact that its bad practice to include scriplets in jsp. I don't see the need to create a value object here so what do I do?
Thanks.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
unfortunatly you need a form class for this. This form class can then simply hold the email address.
This info you can retrieve in the entry action and then store it again in the exit action
Like this
entry (retrieve and call setter of form)
-> jsp
-> exit (store form into db again)
The problem you have is that the html:text tag is also only working in a html:form element.
olli
 
Reinhold Gruber
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I think that

should to the job
 
Wes Hughes
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I realized what I need to do is associate the form with the not only the Action that processes the information in the form but also the Action that retrieves the email address for me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic