URLConnection Return
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shiva_prasad
Posted On:   Monday, May 24, 2004 03:28 PM

I am calling a servlet in a java class through URL class. Doing openStream to send the request and get the response. In servlet response: How do I send the data back in key-value pairs? In a client class: For ex: URL u = new URL("http://localhost/servlet/questionServlet?question=q1"); InputStream in = u.openStream(); while ((b = in.read()) != -1) { System.out.write(b); } Say response from servlet: answer=a1; How does selevlet send the response in key-value pairs? How does this client read the response from servlet in key-value pairs? Thanks Shiva    More>>
			
I am calling a servlet in a java class through URL class. Doing openStream to send the request and get the response.

In servlet response: How do I send the data back in key-value pairs?

In a client class:
For ex: URL u = new URL("http://localhost/servlet/questionServlet?question=q1");
InputStream in = u.openStream();
while ((b = in.read()) != -1) {
System.out.write(b); }

Say response from servlet: answer=a1;


How does selevlet send the response in key-value pairs? How does this client read the response from servlet in key-value pairs?


Thanks
Shiva
   <<Less

Re: URLConnection Return

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, May 24, 2004 05:16 PM

The answer is, it doesn't.


You get a stream, and you write out a stream. Anything inside that stream is up to you.

About | Sitemap | Contact