Title: RE: Post/Get is NOT working on Apache - POST is Not allowed at Port 80 error

Thank you very much for your comment and I will definitely
check on it.  But it there anything else I have to except
the HttpServlet have doPost override? such as changing
classpath or changing setting on Servlet under Web application
of JMC of JRUN default server?

The context of the httpservlet not including actual classes are as,

package KeyDistribute;

import java.lang.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


//*========================================================================*
//*    WELCOME TO << CERT AND EXODUS KEY MANAGEMENT SYSTEM >>              *
//*                                                                        *
//*    This programs and methodology is propected by                       *
//*    U.S. and International Copy Right                                   *
//*                                                                        *
//*    Any attempt to copy or replicate all or any part of this            *
//*    property is subject to full extension of legal                      *
//*    prosecution                                                         *
//*------------------------------------------------------------------------*
//*    This program was designed and developed by Hitae Lee                *
//*------------------------------------------------------------------------*

public class KeyDistribute extends HttpServlet {

   public void doGet(HttpServletRequest req, HttpServletResponse res)
                  throws ServletException, IOException
    {
       int i, j;
       String outKey;

       res.setContentType("text/html");
       PrintWriter out = res.getWriter();

       // E-Commerce will be charged under this account
       // We will add an additional SQL logic to create
       // a billing record -- billing would be free though

       String account = req.getParameter("Account");

       out.println("<HTML>");
       out.println("<HEAD><TITLE> Message from RSA public key distribution Management System </TITLE></HEAD>");
       out.println("<BODY>");
       out.println("<body bgcolor=\"#FFFFFF\" >");
       out.println("<p><font face=\"Arial\"><small>");
       out.println(" Congratulation!!! <br><br><br> ");
       out.println(" You made very smart decision to protect your important financial <br> ");
       out.println(" information from would be attackers by encrypting it using <br> ");
       out.println(" patented method of RSA and CertandExodus 3-way encryption/decryption <br><br><br> ");
       out.println(" Please wait we are creating digital envelop using RSA's public/private key,<br> ");
       out.println(" your password and CertandExodus bit manipulator...<br> <br>");

       String password = req.getParameter("Password");
       // E-Commerce may define this field as Hidden to optimize their
       // service fee to CertandExodus Venture Inc.
       String   skeyLength = req.getParameter("KeyLength");
       int keyLength = Integer.parseInt(skeyLength, 10);
       KeyDatabase oKeyDB;
       oKeyDB = new KeyDatabase();
       oKeyDB.Connect();
       int keyLengthType = 0;
       if(keyLength == 512)
         {
           keyLengthType = 1;
         }
       if(keyLength == 768)
         {
           keyLengthType = 2;
         }
       if(keyLength == 1024)
         {
           keyLengthType = 3;
         }
       if(keyLength == 1280)
         {
           keyLengthType = 4;
         }
       if(keyLength == 1536)
         {
           keyLengthType = 5;
         }
       if(keyLengthType == 0)
         {
         out.println(" Your merchant did not specify a correct key length <br> ");
         out.println(" The default key length of 768 bits will be used <br> ");
         keyLengthType = 2;
         }
       PublicKeyRec key;
       key = oKeyDB.getKey(keyLengthType);
       byte[] PublicKey = null;
       PublicKey = oKeyDB.getPublicKey(key);
       RandomRec rkey;
       rkey = oKeyDB.getRandomKey(keyLength, key.getkeySequence());
       byte[] Random = null;
       Random = oKeyDB.getRandom(rkey);
       out.println(" Your key has been selected from our repository database... <br> ");
       oKeyDB.markDistribution(keyLength, key.getkeySequence());
       oKeyDB.close();

       // Now we need encrypt the public and creates digital envelop
       pbePublicKey oPbEncryptor;
       oPbEncryptor = new pbePublicKey();
       byte[] Certificate = null;
       Certificate = oPbEncryptor.pbEncrypt(password.toUpperCase(), PublicKey, keyLength, key.getkeySequence());
       out.println(" Key distribution has been completed successfully <br><br><br> ");
       out.println(" The same key and your password will be used anytime  <br> ");
       out.println(" you submit your credit card to merchant who uses our service <br> ");
       out.println(" Please inquire your merchant by clicking <a href=\"http://www.certificateissuer.com\">here</a> ...  <br> <br> <br> ");

       out.println(" If you want to use the same key and password to shop anywhere in world<br> ");
       out.println(" Please inquire <a href=\"http://www.chipcardandCA.com\">here</a> to make a smartcard with your personal information<br> ");

       byte[] fullCertificate = null;
       Integer i1 = new Integer(Random.length);
       Byte b1 = new Byte(i1.byteValue());
       fullCertificate[0] = b1.byteValue();
       for(i = 0; i <Random.length; i++)
       {
          fullCertificate[i + 1] = Random[i];
       }
       for(i = 0; i <7; i++)
       {
          j = Random.length;
          Integer i2 = new Integer(187);
          Byte b2 = new Byte(i2.byteValue());
          fullCertificate[i + 1 + j] = b2.byteValue();
       }
       for(i = 0; i <Certificate.length; i++)
       {
          j = Random.length;
          fullCertificate[i + 7 + j] = Certificate[i];
       }

       outKey = getString(fullCertificate);
       out.println(" along with COOL smartcard reader which can be easily attached to your PC <br><br><br> ");
       out.println(outKey + " <br><br><br> </p> ");
       out.println("</small><br>");
       out.println("</body>");
       out.println("</html>");

      }
   // keyLength must be 64 for 512, 96 for 768, 128 for 1024 and 256 for 2048
   public String getString (byte[] inKey)
      {
         String strKey;
         int i1, i2;

         strKey = "";
         for(int i = 0; i < inKey.length; i++)
         {
            i1 = inKey[i] % 16;
            i2 = inKey[i] / 16;
            if(i2 * 16 > inKey[i])
              {
                i2--;
              }
            if(i2 == 15) strKey = strKey + "F";
            if(i2 == 14) strKey = strKey + "E";
            if(i2 == 13) strKey = strKey + "D";
            if(i2 == 12) strKey = strKey + "C";
            if(i2 == 11) strKey = strKey + "B";
            if(i2 == 10) strKey = strKey + "A";
            if(i2 == 9) strKey = strKey + "9";
            if(i2 == 8) strKey = strKey + "8";
            if(i2 == 7) strKey = strKey + "7";
            if(i2 == 6) strKey = strKey + "6";
            if(i2 == 5) strKey = strKey + "5";
            if(i2 == 4) strKey = strKey + "4";
            if(i2 == 3) strKey = strKey + "3";
            if(i2 == 2) strKey = strKey + "2";
            if(i2 == 1) strKey = strKey + "1";
            if(i2 == 0) strKey = strKey + "0";

            if(i1 == 15) strKey = strKey + "F";
            if(i1 == 14) strKey = strKey + "E";
            if(i1 == 13) strKey = strKey + "D";
            if(i1 == 12) strKey = strKey + "C";
            if(i1 == 11) strKey = strKey + "B";
            if(i1 == 10) strKey = strKey + "A";
            if(i1 == 9) strKey = strKey + "9";
            if(i1 == 8) strKey = strKey + "8";
            if(i1 == 7) strKey = strKey + "7";
            if(i1 == 6) strKey = strKey + "6";
            if(i1 == 5) strKey = strKey + "5";
            if(i1 == 4) strKey = strKey + "4";
            if(i1 == 3) strKey = strKey + "3";
            if(i1 == 2) strKey = strKey + "2";
            if(i1 == 1) strKey = strKey + "1";
            if(i1 == 0) strKey = strKey + "0";

         }

         return strKey;
      }

   public void doPost(HttpServletRequest req, HttpServletResponse res)
   {
       try
         {
           doGet(req, res);
        }
      catch (ServletException e)
         {
           System.out.println("Servlet is not supported");
         }
      catch (IOException e)
         {
           System.out.println("General IO Error");
         }

    }


}

Again, Thank you very much for your help.

Hitae Lee.
Founder
Cetandexodus Venture Inc.
  Building International Payment System based on PKCS/ANSI/NIST encryption
  technique with 3-way encryption technology.
www.chipcardandCA.com

-----Original Message-----
From: Lynn Walton [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 28, 2000 10:53 AM
To: [EMAIL PROTECTED]
Subject: Re: Post/Get is NOT working on Apache - POST is Not allowed at
Port 80 error


Is it just your own servlet that you are trying to call from a web page
with a <form method="post"> but perhaps you only implemented the doGet
rather than both doGet and doPost methods?  The Post Method not allowed
message is what I would expect if you didn't implement doPost but were
calling the servlet with a <form method="post"> tag.   But you didn't
give any details on what servlet you're trying and how you're accessing
it?

Hope this helps,
Lynn

"Lee, Hitae" wrote:

>
>
> Dear,
>
> Can some one please help me on this matter?
>
> I am using Apache as Web Server as JRUN server
> as Servlet Engine.
>
> I connected default and admin JRUN server to Apache
> by following instruction by JRUN.
>
> I also registered Servlet using JMC. However, as I
> tried to run the servlet it returns "Post Method not allowed
> at Port 80".
>
> The files for apache and web site are as.
> <<access.conf>> <<httpd.conf>> <<KeyDistribute.java>> <<mime.types>>
> <<Register.htm>> <<srm.conf>> <<srm.default>> <<testKey.htm>>
>
> Thank you in advance for helping me to solve this strange problem.
> Hitae Lee.

------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to