Home » Source Code » Jsp servlets » ServletUserDelete.java

ServletUserDelete.java ( File view )

From:Jsp servlets
Description:we will create...
  • By asdf 2014-08-06
  • View(s):228
  • Download(s):2
  • Point(s): 2
			package com.hongli.controller;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hongli.dao.UserDao;
import com.hongli.model.UserVO;

/**
 * Servlet implementation class ServletUserDelete
 */
public class ServletUserDelete extends HttpServlet {

	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ServletUserDelete() {

        super();
        // TODO Auto-generated constructor stub
    
}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		// TODO Auto-generated method stub
		int userid = Integer.parseInt(request.getParameter("userid"));
		UserDao userDao = new UserDao();
		userDao.deleteUser(userid);
		ArrayList<UserVO> list = userDao.showUserList();
		request.setAttribute("list",list);
		request.getRequestDispatcher("/userlist.jsp").forward(request, response);	
	
}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		// TODO Auto-generated method stub
		String userid[] = request.getParameterValues("num");
		UserDao userDao = new UserDao();
		userDao.deleteUserList(userid);
		
		ArrayList<UserVO> list = userDao.showUserList();
		request.setAttribute("list", list);
		request.getRequestDispatcher("/userlist.jsp").forward(request, response);
	
}

}
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 2

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
.classpath997.00 B2014-07-28 10:01
.project1.03 kB2014-07-28 09:57
01.97 kB
.jsdtscope503.00 B2014-07-28 09:57
org.eclipse.jdt.core.prefs364.00 B2014-07-28 09:57
org.eclipse.wst.common.component506.00 B2014-07-28 09:57
org.eclipse.wst.common.project.facet.core.xml345.00 B2014-07-28 09:57
org.eclipse.wst.jsdt.ui.superType.container49.00 B2014-07-28 09:57
org.eclipse.wst.jsdt.ui.superType.name6.00 B2014-07-28 09:57
01.97 kB
01.97 kB
01.97 kB
01.97 kB
01.97 kB
ServletUserDelete.class1.98 kB2014-08-01 16:58
ServletUserLogin.class2.17 kB2014-08-04 14:58
ServletUserRegister.class2.66 kB2014-08-01 14:56
ServletUserReturn.class1.49 kB2014-08-01 18:42
ServletUserUpdate.class3.25 kB2014-08-04 16:03
ServletUserView.class1.57 kB2014-08-01 17:18
01.97 kB
UserDao.class6.15 kB2014-08-04 15:25
01.97 kB
UserVO.class2.10 kB2014-08-01 16:45
01.97 kB
DBmanage.class1.68 kB2014-08-01 16:03
SQL10.80 kB2014-07-21 16:42
UserDB485.00 B2014-08-01 19:01
01.97 kB
01.97 kB
01.97 kB
01.97 kB
ServletUserDelete.java1.76 kB2014-08-01 16:55
ServletUserLogin.java1.85 kB2014-08-04 14:58
ServletUserRegister.java2.19 kB2014-07-29 17:00
ServletUserReturn.java1.38 kB2014-08-01 18:42
ServletUserUpdate.java2.65 kB2014-08-04 16:03
ServletUserView.java1.40 kB2014-08-01 17:17
01.97 kB
UserDao.java4.56 kB2014-08-04 15:25
01.97 kB
UserVO.java1.56 kB2014-08-01 16:45
01.97 kB
DBmanage.java978.00 B2014-08-01 16:03
SQL10.80 kB2014-07-21 16:42
UserDB485.00 B2014-08-01 19:01
01.97 kB
countries.js54.95 kB2014-07-28 11:51
01.97 kB
MANIFEST.MF39.00 B2014-07-28 09:57
userlist.jsp2.46 kB2014-08-01 19:10
userlogin.jsp1.21 kB2014-08-01 19:08
userregister.jsp1.96 kB2014-08-01 19:06
userupdate.jsp2.10 kB2014-08-04 15:12
userview.jsp1.34 kB2014-08-01 18:24
01.97 kB
01.97 kB
web.xml2.90 kB2014-08-01 19:20
...
Sponsored links

ServletUserDelete.java (64.56 kB)

Need 2 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D