0

This is my jsp page: I have value username:

            <td ><input type="text" name="users" value="${viewuser.username}"><c:out value="${viewuser.username}" /></td>
             <td><c:out value="${viewuser.firstname}" /></td>
              <td><c:out value="${viewuser.lastname}" /></td>
               <td><c:out value="${viewuser.dob}" /></td>
                <td><c:out value="${viewuser.address}" /></td>
                 <td><c:out value="${viewuser.mobileno}" /></td>
                  <td><c:out value="${viewuser.type}" /></td>
                  <form action="viewUserEducation" method="get">
                   <td><button class="buttonlogout1" >Education</button> 

And in my servlet I have

 System.out.println(request.getParameter("users"));

but the output shows null value is there I'm missing something. what should I have to do to get the correct value?

yogesh chavan
  • 599
  • 5
  • 16

1 Answers1

1

Your Input filed is outside of the form, so it is not send to the backend. Change your code and make sure that all Input fileds are inside of your form tag. For example:

      <form action="viewUserEducation" method="get">
      <td ><input type="text" name="users" value="${viewuser.username}"><c:out value="${viewuser.username}" /></td>
         <td><c:out value="${viewuser.firstname}" /></td>
          <td><c:out value="${viewuser.lastname}" /></td>
           <td><c:out value="${viewuser.dob}" /></td>
            <td><c:out value="${viewuser.address}" /></td>
             <td><c:out value="${viewuser.mobileno}" /></td>
              <td><c:out value="${viewuser.type}" /></td>
               <td><button class="buttonlogout1" >Education</button></td>
               </form>
Jens
  • 67,715
  • 15
  • 98
  • 113