Title: RE: How to run servlets in JSDK 2.1

      Hello Rubi,

      You can put ur html file in jsdk\examples\html\*.html
      Ur servlet files in jsdk\examples\web-inf\servlets\*.class
      And just write the URL as
      <http://localhost:8080/examples/html/urhtmlfilename>

      just check ur HTML code I have made correction

      Thanx & Regards,

        Syed Atif Ali Kazmi
        Analyst Programmer
        Systems Private Limited, Karachi.
        Voice:  (Off.)  092-021-4549385-88
                (Res.)  092-021-404148

        Fax No.:  092-021-4549389

      Email:  [EMAIL PROTECTED]  & [EMAIL PROTECTED]




      Hello,
      I'm trying to run a servlet with the server with the jsdk 2.1 server and I don't know where I have to put my HTML file and the servlet that it calls.
      Can somebody tell me how can I run this servlet using this jsdk 2.1 server (without others web servers).
      Thank's in advance.
      I have this HTML page:

          <html>
          <head>
          <title></title>
          </head>
          <body>
          <form action="/servlet/Prova" method=POST>
          <BR>
          <BR>Introdueixi un text i premi "Acceptar"<BR>
          <BR>
          <input type=text name=TEXTO>
          <BR>
          <BR><input type=submit><input type=reset></form>
          </body>
          </html>

      This page call this servlet named Prova:

          import javax.servlet.*;
          import javax.servlet.http.*;
          import java.io.*;
          public class Prova extends HttpServlet
          {
            public void service(HttpServletRequest req, HttpServletResponse res)
                        throws ServletException, IOException
            {
              PrintStream out = new PrintStream(res.getOutputStream());
              res.setContentType("text/html");
              String TEXTO    = req.getParameter("TEXTO");
              out.println("<p>Usted ha escrito : "+TEXTO+"</p>");
            }
           }




Reply via email to