Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

making textbox fields null after submit

 
Vikram Deshmukh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
i've solved my prob with JavaWebServer2.0 , anyway, some of ur suggestions to my previous post
were worth learning .
I did my assignment in Servlet successfully , in the sense of addition of new records with JDBC.
But after i say submit in the form (.html), how come i can make those entries null ?
One soln is to using PrintWriter
using that have code like
pw.println(" ....html code ");
make a form like prev html has .
But then am i supposed to hardcode, starting from html , body , form name tag ?
ur addtional suggestions r always welcome !
from ,
vikram .
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use a template system for this. Imagine you have a HTML file on your disk, and in each of the form fields you have something like VALUE="%address2%". To send the page from the servlet, read through it and substitute each %something% with whatever value is appropriate.
You can either write your own template processor (a basic one is quite easy, just an excercise in using StringTokeizer or StreamTokenizer) or use one of the available open source projects like WebMacro http://www.webmacro.org or FreeMarker http://freemarker.sourceforge.net/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic