云相册云服务器servlet:
package servlet; import java.io.DataOutputStream; import java.io.IOException; 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 dao.dao; /** * Servlet implementation class addphoto */ @WebServlet("/addphoto") public class addphoto extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public addphoto() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); dao p=new dao(); String id=request.getParameter("userid"); String photoid=request.getParameter("photoid"); String time=request.getParameter("time"); p.addphoto(id,photoid,time); DataOutputStream os=new DataOutputStream(response.getOutputStream()); os.writeUTF("添加成功!"); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }