This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Properties object values are null  RSS feed

 
fedai gandjaliyev
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I'm trying to establish an applet-servlet communication where I use the Properties
object to pass parameters from the applet to the servlet!
The reason of using the Properties object is that I pass the password as a parameter and it's shown in the address bar of the servlet generated page!
The following works fine
The applet part

for which the servlet part is this


This works fine. But in the following combination of the applet-servet communication
the values of the Properties object are null!
Here is the applet part

And here is the doGet of the servlet in reply to the applet

The size of the the Properties object "table" is 0 in this case and the values are null!
Please help!
Thank you!
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP is a request-response protocol. By making a setting up a request but not reading in the response, you are not fulfilling your part of the protocol so your request never gets sent. You actually have two requests in your code:

Request 1 never gets sent because you don't read the response. Request 2, which actually gets sent by the browser navigating away from your applet, doesn't have the properties object serialized in the request. That's the one being processed by your servlet.
 
fedai gandjaliyev
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the explanation!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!