|
Hello, everybody! I have two questions about servlets and the way the client connects to them. If i have a client program written in java and i have to send multiple requests to a servlet from the client, should i do new connection for each request? Can i create just one connection and use it every time i send request to the same servlet? But in this case(i use get method for requests) the url will be different every time because of the different parameters for the different request...so does that mean that there is no way to use the same connection for different requests?
The second question is about sending requests using post method. All i found about that is that the parameters have to be sent on "a separate line"(not in the url) and thats all. What do they mean saying "separate line"? Should i send parameters through a method of the connection object or directly through the output stream? I tried to find a suitable method in the URLConnection API but i couldn't find. Please, help! Thank you, in advance!
|