School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,124 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,050 people online right now. Registration is fast and FREE... Join Now!




Connection to a servlet

 

Connection to a servlet, Sending parameters

Vikito

20 Aug, 2009 - 05:33 AM
Post #1

New D.I.C Head
*

Joined: 17 Apr, 2009
Posts: 6

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!

User is offlineProfile CardPM
+Quote Post


Aeternalis

RE: Connection To A Servlet

24 Aug, 2009 - 11:55 AM
Post #2

D.I.C Regular
***

Joined: 13 Jul, 2009
Posts: 273



Thanked: 25 times
My Contributions
Perhaps this should be in Java.. might get a response there.


Mods, mind moving him?
Aet
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 02:15PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month