简体   繁体   中英

reload jsp page from servlet

I have a jsp page with a table. Every row of the table call a servlet that delete value from that row. Now I have to recall from servlet the same jsp page but I have to reload that for show the update. How can I do that??

this is the jsp calling servlet code

<tr class="row" data-href="${pageContext.request.contextPath}/adminServlet>
        <td><c:out value="${product.id}" /></td>
        <td><c:out value="${product.name}" /></td>
        <td><c:out value="${product.cost}" /></td> 
</tr>

and this is how I recall jsp page from servlet

RequestDispatcher rd=request.getRequestDispatcher("admin.jsp");    
rd.include(request,response); 

You can use ajax for this problem. Load table data in a jsp as a response from the servlet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM