title: request.getParameter returns null value: JSP, servlet
body: <p>i have connected my login.jsp and registration.jsp to my database, signup is successful but when i login i get error message "password invalid"  i think my code has a problem, please can someone help me solve that, the code is found below . Thanks in advance.</p>
  
  <p>login.jsp  </p>
  
  <pre><code>&lt;%@ page import ="java.sql.*" %&gt;
  &lt;%
      String userid = request.getParameter("uname");
      String email = request.getParameter("emailsignup");
      String password = request.getParameter("password");
      Class.forName("com.mysql.jdbc.Driver");
      Connection con = 
  DriverManager.getConnection("jdbc:mysql://localhost:3306/mldn","root","shaddy");
      Statement st = con.createStatement();
      ResultSet rs;
      rs = st.executeQuery("select * from members WHERE uname='" + userid + "' and password='" + password +"'");
      if (rs.next()) {
          session.setAttribute("userid", userid);
          out.println("welcome " + userid);
          out.println("&lt;a href='logout.jsp'&gt;Log out&lt;/a&gt;");
          response.sendRedirect("&lt;a href='index.jsp'&gt;Welcome&lt;/a&gt;");
       } else {
          out.println("Invalid password &lt;a href='index.jsp'&gt;try again&lt;/a&gt;");
      }
  %&gt; 
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;header&gt;
                  &lt;h1&gt;Geo Business/Land inventory&lt;br&gt;&lt;span&gt;Login And Registration&lt;/span&gt;&lt;/h1&gt;
              &lt;/header&gt;
              &lt;section&gt;               
                  &lt;div id="container_demo" &gt;
                      &lt;a class="hiddenanchor" id="toregister"&gt;&lt;/a&gt;
                      &lt;a class="hiddenanchor" id="tologin"&gt;&lt;/a&gt;
                      &lt;div id="wrapper"&gt;
                          &lt;div id="login" class="animate form"&gt;
                              &lt;form  action = 'jsp/login.jsp'&gt; 
                                  &lt;h1&gt;Log in&lt;/h1&gt; 
                                  &lt;p&gt; 
                                      &lt;label for="username" class="uname" data-icon="u" &gt; Your Username &lt;/label&gt;
                                      &lt;input id="username" name="username"  required="required" type="text" placeholder="myusername." value=""/&gt;
                                  &lt;/p&gt;
                                  &lt;p&gt; 
                                      &lt;label for="password" class="youpasswd" data-icon="p"&gt; Your password &lt;/label&gt;
                                      &lt;input id="password" name="password"  required="required" type="password" placeholder=" X8df!90EO" value=""/&gt; 
                                  &lt;/p&gt;
                                  &lt;p class="keeplogin"&gt; 
                                      &lt;input type="checkbox" name="loginkeeping" id="loginkeeping" value="loginkeeping" /&gt; 
                                      &lt;label for="loginkeeping"&gt;Keep me logged in&lt;/label&gt;
                                  &lt;/p&gt;
                                  &lt;p class="login button"&gt; 
                                      &lt;input type="submit" value="Login" /&gt; 
                                  &lt;/p&gt;
                                  &lt;p class="change_link"&gt;
                                      Not a member yet ?
                                      &lt;a href="#toregister" class="to_register"&gt;Join us&lt;/a&gt;
                                  &lt;/p&gt;
                              &lt;/form&gt;
                          &lt;/div&gt;
  
                          &lt;div id="register" class="animate form"&gt;
                              &lt;form  action = 'jsp/registration.jsp'&gt; 
                                  &lt;h1&gt; Sign up &lt;/h1&gt; 
                                  &lt;p&gt; 
                                      &lt;label for="fname" class="fname" data-icon="fn"&gt;First Name&lt;/label&gt;
                                      &lt;input id="fname" name="fname" required="required" type="text" placeholder="myfirstname" value=""/&gt;
                                  &lt;/p&gt;
                                  &lt;p&gt; 
                                      &lt;label for="lname" class="lname" data-icon="ln" &gt;Last Name&lt;/label&gt;
                                      &lt;input id="lname" name="lname" required="required" type="text" placeholder="lastname" value=""/&gt; 
                                  &lt;/p&gt;
                                  &lt;p&gt; 
                                      &lt;label for="email" class="emailsignup" data-icon="e" &gt;Email&lt;/label&gt;
                                      &lt;input id="email" name="email" required="required" type="email" placeholder="cug@wuhan.cn" value=""/&gt; 
                                  &lt;/p
                                  &lt;p&gt; 
                                      &lt;label for="username" class="uname" data-icon="u"&gt;Username &lt;/label&gt;
                                      &lt;input id="username" name="username" required="required" type="username" placeholder="eg. X8df!90EO" value=""/&gt;
                                  &lt;/p&gt;
                                  &lt;p&gt; 
                                      &lt;label for="password" class="youpasswd" data-icon="p"&gt;Password &lt;/label&gt;
                                      &lt;input id="password" name="password" required="required" type="password" placeholder=" eg.X8df!90EO" value="" /&gt;
                                  &lt;/p&gt;
                                  &lt;p class="signin button"&gt; 
                                      &lt;input type="submit" value="Sign up"/&gt;
                                  &lt;/p&gt;
                                  &lt;p class="change_link"&gt;  
                                      Already a member ?
                                      &lt;a href="#tologin" class="to_register"&gt; Go and log in &lt;/a&gt;
                                  &lt;/p&gt;
                              &lt;/form&gt;
                          &lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;  
              &lt;/section&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>