cactus and servletconnection

Martin West <[email protected]> Mon, 22 Sep 2008 14:00:27 +0100
Newsgroups gmane.comp.jakarta.cactus.user
Message-ID <1222088427.7468.17.camel@lenovo3>

Does anyone have a sample of testing SerlvetConnection with Cactus
aka ...
			URLConnection servletConnection = servletURL.openConnection();
			// to allow us to write to the URL ...
			servletConnection.setDoOutput(true); 
			// to ensure that we do contact
			// the servlet and don't get
			// anything from the browser's cache
			servletConnection.setUseCaches(false); 
			servletConnection.setDefaultUseCaches(false);

			// Write the message to the servlet
			PrintStream out = new PrintStream(servletConnection
					.getOutputStream());
			out.println(cmd);
			out.println(subcmd);
			out.println(s);
			out.close();

			// Now read in the response
			StringBuffer buffer = new StringBuffer();
			InputStream in = servletConnection.getInputStream();
			int chr;
			while ((chr = in.read()) != -1) {
				buffer.append((char) chr);
			}
			in.close();

Could not see anything in the docs/samples

Thanks
-- 
regards 
   Martin West