2014-09-17 11 views
0

내 직원 확장 목록 프로젝트의 관리 페이지를 만듭니다. 모든 행 옆에 편집 및 삭제 단추를 놓았습니다. 코드는 다음과 같습니다.테이블 행의 편집 버튼을 클릭하면 편집 페이지로 리디렉션됩니다.

<table id="myTable"> 
     <thead> 
      <tr> 
       <th>Last Name</th> 
       <th style="width: 175px" >First Name</th> 
       <th style="width: 175px" >Extension</th> 
       <th id="locHead" class=">Location</th> 
       <th style="width: 175px" >Cell</th> 
       <th id="teamHead" class=">Team(s)</th> 

      </tr> 
     </thead> 
     <tbody> 
      <% 
      List<Employee> list = new ArrayList<Employee>(); 

      PhoneListController controller = new PhoneListController(); 
      list = controller.getAllContacts(); 
      for (Employee e : list) { 

      %>    
      <tr> 
       <td id="lastName"></td> 
       <td style="width: 175px"><%=e.getFirst()%></td> 
       <td style="width: 135px"><%=e.getExt()%></td> 
       <td><%=e.getLoc()%></td> 
       <td style="width: 175px"><%=e.getCell()%></td> 
       <td ><%=e.getTeam()%></td>     
       <td style="border: none; width: 50px"> 
         <div> 
          <form method="post" action="empUpdate.jsp"> 
           <input type="hidden" id="updateId" name="updateId" value="<%=e.getRecNo()%>"/> 
           <input type="submit" value="Modify" onclick="document.location.href='EditEmployee.jsp';"/> 
          </form> 
         </div> 
        </td> 
        <td style="border: none; width: 50px"> 
         <div> 
          <form method="post" action="DeleteServlet"> 
           <input type="hidden" id="delId" name="delId" value="<%=e.getRecNo()%>"/> 
           <input type="submit" value="Delete"/> 
          </form> 
         </div> 
        </td> 
      </tr> 

      <% 
       } 
      %> 
     </tbody> 
    </table> 

마지막 두 요소에는 수정 및 삭제 버튼이 있습니다. 수정 버튼을 클릭하면 recNo 필드에 미리 채워진 데이터로 편집 페이지로 리디렉션 될 것으로 예상됩니다. 그러나 그것은 단순히 아무 것도하지 않습니다. 누구든지 제가 잘못하고있는 곳을 제안 할 수 있습니까? 내가 이것을 성취 할 수있는 다른 방법이 있습니까? JSP 서블릿을 사용하고 있습니다.

도와주세요.

감사합니다.

답변

0

이 문제를 발견했습니다. 나는 post보다는 method = "get"을 써야했다. 그것은 그 문제를 해결했습니다.

관련 문제