• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to pass string from applet to servlet

 
Alistair Andrew
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to pass a string from an applet to a servlet's doGet method but it keeps returning null on the servlet side. Any ideas on why this is happening, and how to debug this kind of problem in the future?
Applet Code
Servlet Code
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setRequestProperty method sets a request header, it does NOT give the effect of a form parameter that you would use getParameter for.

Form parameters to be read by doGet should be put in the URL string - for doPost they go in the body of the request.

for debugging, having a browser plugin that shows exactly what is being transmitted and received such as Firebug for Firefox is what you want.

Bill
 
Alistair Andrew
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, I actually knew that but somehow I didn't think that it would be as easy as putting the field straight into the URL.

I just pasted the shiftDate right into the URL and it worked first time! Thank you very much!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic