code064.java
package pack01;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class code064 extends HttpServlet
{
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
doPost(request, response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
PrintWriter writer1 = response.getWriter();
String id = request.getParameter("id");
String name = request.getParameter("name");
String author = request.getParameter("author");
String price = request.getParameter("price");
writer1.println("<h2>ͼ����Ϣ��ӳɹ�</h2>");
writer1.println("ͼ���ţ�" + id +"<br>");
writer1.println("ͼ�����ƣ�" + name + "<br>");
writer1.println("���ߣ�" + author + "<br>");
writer1.println("�۸�" + price + "<br>");
writer1.flush();
writer1.close();
}
/*
* ����tomcat�ķ�����web.xml������
*<servlet>
* <servlet-name>code064</servlet-name>
* <servlet-class>pack01.code064</servlet-class>
*</servlet>
*<servlet-mapping>
* <servlet-name>code064</servlet-name>
* <url-pattern>/page04/AddServlet</url-pattern>
*</servlet-mapping>
*</web-app>
*/
}