一个servlet解决增删改查

现在用三大框架来开发,快是很快,什么事务,转发的非常容易了,回到原始的开发模式:

 

FlowcardServlet

 

@Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String command = request.getParameter("command");
        if (Constants.ADD.equals(command)) {
            add(request, response);
        }else if (Constants.DEL.equals(command)){
           
        }else {
            search(request, response);
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        doGet(request,response);
    }

 

在页面上调用 的时候:

<form name="flowCardAddForm" method="post" action="servlet/flowcard/FlowcardServlet">
                <input type="hidden" name="command" value="${add }">

你可能感兴趣的:(框架,servlet)