32 lines
916 B
Java
32 lines
916 B
Java
|
package example.controller;
|
||
|
|
||
|
import example.service.IOrdersService;
|
||
|
import example.service.impl.OrdersServiceImpl;
|
||
|
|
||
|
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 java.io.IOException;
|
||
|
|
||
|
@WebServlet("/orders")
|
||
|
public class OrdersServlet extends HttpServlet {
|
||
|
|
||
|
IOrdersService ordersService=new OrdersServiceImpl();
|
||
|
|
||
|
@Override
|
||
|
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||
|
String action = req.getParameter("action");
|
||
|
switch (action) {
|
||
|
case "all":
|
||
|
ordersService.allOrder(req, resp);
|
||
|
break;
|
||
|
case "delete":
|
||
|
// ordersService.delete(req, resp);
|
||
|
break;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|