Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get an editable text field in a servlet( out.println) statement

 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have a situation where i need to show a prepopulated text field which should be editable in a servlet. This editable text area should then be saved in to an oracle table.
Can someone please help me as to how can I implement this.

Thanks

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you been though this? Its a good place to start.

If you have what part are you stuck on? What have you got so far?
 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written this code but cannot get the value of the variable in the text field:



The value printed in the text field is <%=name%> but the value of the String owner variable should be printed

Please can some point out where I am making mistake?

Thanks
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"<%=name%>" is JSP notation, but you're not using JSP. Any anyway, the name of your variable is "owner", not "name". Try this:

out.println("<input type='text' name='owner' value='"+owner+"'>");
 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

The issue got resolved with your statement!!!

Many Thanks

Moieen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic