2 Replies Latest reply on Dec 16, 2002 1:45 PM by simperitog

    HTTP POST

    simperitog

      Is HTTP POST supported in JBOSS 3.0.4/4.1.12 ? If so , what needs to done configuration wise ? Is there any xml config file that needs to be tweaked - there seems to be no dearth of these files.

      The following is the error message I get on the client side.

      "java.io.IOException: Connection failure with 405"
      HTTP Method POST is not supported by this URL.

        • 1. Re: HTTP POST
          ericcire

          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

            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);
            }