www.pudn.com > xunibuluo.rar > things.java


package data; 
 
import java.io.IOException; 
import java.sql.SQLException; 
 
import javax.servlet.ServletException; 
import javax.servlet.http.HttpServlet; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
import javax.servlet.http.HttpSession; 
 
public class things extends HttpServlet { 
	private static final long serialVersionUID = 2315156614289693989L; 
 
	public void doPost(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException { 
		response.setContentType("text/html; charset=GBK"); 
		HttpSession session = request.getSession(); 
		String soldid=(String)session.getAttribute("id"); 
		String pic=(String)session.getAttribute("shoppic"); 
		String thingname  = new String(request.getParameter("thingname").getBytes("iso-8859-1")); 
		String thingmes  = new String(request.getParameter("thingmes").getBytes("iso-8859-1")); 
		String starttime  = new String(request.getParameter("starttime").getBytes("iso-8859-1")); 
		String endtime  = new String(request.getParameter("endtime").getBytes("iso-8859-1")); 
		String find  = new String(request.getParameter("find").getBytes("iso-8859-1")); 
		String money  = request.getParameter("money"); 
		shopdb kk=new shopdb(); 
		try { 
				kk.addthing(soldid, thingmes, thingname, starttime, endtime, money, pic, find); 
				response.sendRedirect("myshop.jsp"); 
		}catch (SQLException e) { 
			// TODO ×Ô¶¯Éú³É catch ¿é 
			e.printStackTrace(); 
		} 
} 
}