[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: JBOSS 4.2.0 GA and local socket connection
jova73
do-not-reply at jboss.com
Mon Sep 10 04:12:32 EDT 2007
Hi Jaikiran,
here's my code:
| String urlPath = "http://127.0.0.1:"
| + pageContext.getRequest().getServerPort()
| + request.getContextPath() + "/myservlet";
| URL url = new URL(urlPath);
| URLConnection connection = url.openConnection();
| String cookie = request.getHeader("Cookie");
| connection.setRequestProperty("Cookie", cookie);
| connection.setRequestProperty("charset", "ISO-8859-1");
| connection.setDoOutput(true);
| OutputStreamWriter ostream = new OutputStreamWriter(connection.getOutputStream());
| BufferedWriter out = new BufferedWriter(ostream);
| ... // write something to the servlet
| out.flush();
| out.close();
| is = connection.getInputStream();
| ... // read servlet response
|
Thanks!
Andrea
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082488#4082488
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082488
More information about the jboss-user
mailing list