• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2 Part Question

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. I have a form that requests 2 entries. When I submit this, I also need to send one other value along with the other 2 that the user does not enter, but it will change with each dynamically built HTML page.
2. Can you send values to a servlet through <A HREF> without using a FORM?
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg
1. Can you use a hidden form field? It is an HTML input field who's type is 'hidden'. when the page is created set its value t wheatever you want it to be and it will be sent with the user inputs to the servlet.
2. If your dynamically building the href you can just append a '?name=value. Onto the end of it and then it is accesible through the request parameters.
hope that's what you're looking for
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's perfect Dave. Exactly what I was looking for. Thanks a bunch!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use an <a> tag to invoke the servlet, be sure that you have implemented doGet().
hth,
bear
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic