Hi Chris excuse me ,
I will be more specific :
Please take a look at the two following servlets : "servlet08" and
"sevlet18"
"servlet08" dispalys a POST FORM with 2 fields  (name and password)
the action associeted to this POST FORM is servlet18 which when invokek by
clicking the OK
Button in servlet08 , get parameters name and password and dispalys them
(just to be sure that it has
received correct information) .
Could anybody please take a look to these simple servlets and tell me what
is missing in either servlet08
 or servlet18 so that servlet18 can be invoked by clicking OK button in
servlet08.
Note that servlet08 works fine, and servlet18 works also fine when accessed
separatly .

THANKs in advance

here "servlet08.java" code :

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

public class servlet08 extends HttpServlet {

   public void doGet(HttpServletRequest req,HttpServletResponse resp)
               throws IOException , ServletException
       {
          doPost(req,resp);
       }



   public void doPost(HttpServletRequest request,HttpServletResponse
response)
               throws IOException , ServletException
       {
         PrintWriter out;
         String title = "Simple Servlet Output";

     /* set content type and other response header fields first */

                              response.setContentType("text/html");

     /* write the data of the response */

        out = response.getWriter() ;
        out.println("<HTML><HEAD><TITLE>");
        out.println(title);
        out.println("</TITLE></HEAD><BODY>");
        out.println("<H1>" + title + "</H1>");
        out.println("<P>This is output from servlet08 Servlet.");
        out.println("<FORM METHOD=POST ");
        out.println("ACCTION=http://localhost:8081/servlet/servlet18>");
        out.println("<P> Nom de Login : ");
        out.println("<INPUT NAME=name TYPE=TEXT SIZE=8>");
        out.println("<P>Mot de Passe  : ");
        out.println("<INPUT NAME=pwd TYPE=PASSWORD SIZE=10>");
        out.println("<P><INPUT NAME=Conf TYPE=SUBMIT VALUE=OK>");
        out.println("</FORM>");
        out.println("</BODY></HTML>");
        out.close();
      }
  }


here servlet18.java code:


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

public class servlet18 extends HttpServlet {

   public void doGet(HttpServletRequest req,HttpServletResponse resp)
               throws IOException , ServletException
       {
          doPost(req,resp);
       }


   public void doPost(HttpServletRequest req,HttpServletResponse resp)
               throws IOException , ServletException
       {
          handleParam(req,resp);
       }

public void handleParam(HttpServletRequest request,HttpServletResponse
respon
se)
               throws IOException , ServletException
       {
       /*  doGet(request,response);  */
         PrintWriter out;
         String title = "Simple Servlet Output";
         String user = null;
         String passwd = null;

     /* set content type and other response header fields first */

        response.setContentType("text/html");

     /* write the data of the response */

        out = response.getWriter() ;
        out.println("<HTML><HEAD><TITLE>");
        out.println(title);
        out.println("</TITLE></HEAD><BODY>");
        out.println("<H1>" + title + "</H1>");
out.println("<H1>" + title + "</H1>");
        out.println("<P>This is output from servlet18 Servlet.");
        user = request.getParameter("name");
        passwd =request.getParameter("pwd");
        out.println("<P>User = " + user);
        out.println("<P>Pwd  = " + passwd);
        out.println("</BODY></HTML>");
        out.close();
      }
}










----- Message d'origine -----
De : Chris Pratt <[EMAIL PROTECTED]>
A : <[EMAIL PROTECTED]>
Envoy� : lundi 20 septembre 1999 07:41
Objet : Re: Stil having Problem with POST FORM


> Yes, I know exactly how I wrote the servlet.  I used Visual SlickEdit to
> type it in.  Compiled it using the Sun JDK 1.1.8 for Windows NT, then
> deployed it on JavaWebServer 1.1.3 patch 1.  If you are asking more than
> that, you'll need to be more specific.
>     (*Chris*)
>
> ----- Original Message -----
> From: sidaty <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, September 20, 1999 12:12 AM
> Subject: Re: Stil having Problem with POST FORM
>
>
> > Hi all ,
> >   But my problem still posed .
> >   Any idea about how you have wrote the "LiveLinks" servlet or whatever
> > "ServletXXX" provided that it was
> >   mentionned as actionfor a Post Form in (<FORM action=ServletXXX
> > Method=POST>) for example.
> >   THANKS In advance

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to