-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
QLBF11
authored and
QLBF11
committed
Nov 30, 2020
1 parent
ca9c143
commit 038c487
Showing
6 changed files
with
131 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
UserqueryInfo/src/cn/itcast/servlet/DelSelectedServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cn.itcast.servlet; | ||
|
||
import cn.itcast.service.UserService; | ||
import cn.itcast.service.impl.UserServiceImpl; | ||
|
||
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; | ||
|
||
/** | ||
* @author QLBF | ||
* @version 1.0 | ||
* @date 2020/11/29 22:46 | ||
*/ | ||
@WebServlet("/delSelectedServlet") | ||
public class DelSelectedServlet extends HttpServlet { | ||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
//1.获取id | ||
String[] ids = request.getParameterValues("uid"); | ||
//2.调用service删除 | ||
UserService service=new UserServiceImpl(); | ||
service.delSelectedUser(ids); | ||
|
||
//3.跳转查询所有Servlet,重定向或者转发都行 | ||
response.sendRedirect(request.getContextPath()+"/userListServlet"); | ||
} | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
this.doPost(request, response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters