添加
package com.zhongruan.servlet;
import com.zhongruan.service.IUserService;
import com.zhongruan.service.impl.UserServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class AddServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String username = request.getParameter(“username”);
String password= request.getParameter(“password”);
IUserService userService=new UserServiceImpl();
userService.add(username,password);
request.getRequestDispatcher("/find").forward(request,response);
}
}
`