-
1. Re: HTTP POST
ericcire Dec 16, 2002 11:25 AM (in response to simperitog)JBoss uses Jetty (or Tomcat) for servlets - and http post is supported. If you have a distribution with one of them installed, you should be able to run servlets that accept posts.
You'd have to show some code for anyone to figure out the problem. -
2. Re: HTTP POST
simperitog Dec 16, 2002 1:45 PM (in response to simperitog)Yes, it is mentioned in the email that I am using the
JBoss-Tomcat integrated version.
Here are the code snippets. The client is a simple Applet and the Server is a simple Servlet.
The Applet
==========
smsurlcon = (HttpURLConnection) nurl.openConnection();
smsurlcon.setDoOutput(true);
smsurlcon.setDoInput(true);
smsurlcon.setUseCaches(false);
smsurlcon.setRequestProperty("Content type","text/bsv");
OutputStream os = smsurlcon.getOutputStream();
String sout = "param="+cmd1+","+cmd2+","+cmd3;
os.write(sout.getBytes());
os.flush();
is = smsurlcon.getInputStream();
//is = nurl.openStream();
int i = 0;
while (!(is.available()>0)&& i < 10)
{
i++;
Thread.currentThread().sleep(100);
System.out.println(" waiting " + i);
}
The Servlet
============
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
System.out.println(" Entering doPost()");
System.out.println("Content type: "+request.getContentType());
doX(request, response);
}