public class MenuServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String method = request.getParameter("method");  ---(1)
        if(method.equals("findAllProduct")){
            ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
            ProductService productService = (ProductService) context.getBean("productService");  ---(2)
            out(response,productService.findAllProduct());
        }
    }
}