猿问

问一个JSP页面的跳转问题?

我给这个删除明细 写了一个servlet,如下。 我应该怎么写才能让我点某一行的“删除明细”按钮后,订单的那一行删除但是表格页面还存在这里的?

package web.client;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import domain.Order;
import service.impl.BusinessServiceImpl;

/**
 * Servlet implementation class ClientOrderDeleteServlet
 */
@WebServlet("/ClientOrderDeleteServlet")
public class ClientOrderDeleteServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ClientOrderDeleteServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        String orderid = request.getParameter("orderid");
        BusinessServiceImpl service = new BusinessServiceImpl();
        Order order = service.findOrder(orderid);
        service.deleteOrder(order);  
        request.getRequestDispatcher("/client/clientlistorder.jsp").forward(request, response);              
    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}

http://img.mukewang.com/59647e7a0001dced09610242.jpg

按目前的写法,删除后就成了这个。。。。。

zoeyqq
浏览 1316回答 1
1回答
随时随地看视频慕课网APP

相关分类

Java
JavaScript
我要回答