hi all , I am new to this forum I have a simple question why getParameter() doesn't work with me . My java server page is as follow:

import java.io.*;
   import javax.servlet.*;
   import javax.servlet.http.*;
   public class InputServlet extends HttpServlet
   {
         public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException
          {
                     String name = request.getParameter("Name");
                     response.setContentType("text/html");
                     PrintWriter out = response.getWriter();
                     out.println("<html>");
                     out.println("<head>");
                     out.println("<title>Input Servlet</title>");
                     out.println("</head>");
                     out.println("<body>");
                     out.println("<h1>");
                     out.println("Hello " + name); 
                     out.println("</h1>");
                     out.println("</body>");
                     out.println("</html>");
         }
         public void doPost(HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException
         {
                    doGet(request, response);
         }
}

my html code is below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Input Servlet</title>
</head>
<body>
<form action="http://localhost:8080/servlet/InputServlet" 

method="post">
Enter your name:&nbsp;
<input type="text" name=”Name">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>

the server should return (Hello) fllowed the name user entered it
but I get this Hello null why is that please help

alsoumhi,
Use code tags to post program source code.
” - Invalid double quote char. <input type="text" name=”Name">

<input type="text" name="Name">

oobs thanks man

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.