• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing form varables in a servlet

 
Tom Caldwell
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a database servlet that displays the query results in a html form so that I can click on a row in the results to kick off a 2nd servlet. This all works fine and both servlets run but I'm unable to pass varables as in >
out.println("... onClick=SubmitForm()... in this case submit servlet # 2
out.println("<INPUT TYPE=hidden NAME=parmx value=parm1>");
My problem is that a getParameter("parmx") in servlet # 2 always returns parm1 and not the value of parm1 ???
I expected something like this to work
("<INPUT TYPE=hidden NAME=parmx value="parm1">");
Can't I do it this way???
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't quit understand whet you are asking, but is it as simple as:
 
Tom Caldwell
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Close!! and I didn't think I explained it very well, sorry.
I've already done a getParamer earlier so I'm now just trying to do out.println("<INPUT type='hidden' name='parmx' value='" + parm1 + "'>");
which produces <INPUT type='hidden' name='parmx' value=''> or doesn't pass the value ???
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic