Title: Moloy's Servlet Demo...
") out.println("
  • " + request.getParameter("cname") + " " + request.getParameter("add")); cnt = 2; } out.println("
      "); out.println(""); } catch (Exception e) { out.println("Exception caught: "); } } }
    • use a form tag with this html format.
      after the body tag add
      <form action="/servlet/<name of Servlet>" method = <method used post /get>">
      for the invokation of servlet.
      and then why have u used the counter is it regarding the repeatition of the request.
      hope.
      thanks
      shishir
      ***************************************************
      Change is Inevident everywhere
      It stops  u from Ageing
      ***************************************************
      ----- Original Message -----
      Sent: Tuesday, February 15, 2000 2:02 PM
      Subject: msg from Monalisa

      1. Hello guys


      I am trying to write a simple servlet where I want to input Company Name (cname) and Address (add) . I am enclosing my code with this msg. (please dont laugh)

      Please correct my code if it is wrong

      Love All

      Monalisa


      import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class mservlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); String cname = ""; String add = ""; int cnt = 1; try { //Display the result set as a list out.println(""); out.println(""); while(cnt == 1) { out.println("
      Address.:

      Reply via email to