forward1.java

来自「JAVA分布式程序学习的课件(全英文)」· Java 代码 · 共 31 行

JAVA
31
字号
import javax.servlet.*;
// Souce code for Cart servlet invoked when the
// web form cart.html is submitted
// M. Liu

import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class Forward1 extends HttpServlet
{
   public void doPost(HttpServletRequest request, 
     HttpServletResponse response)
     throws ServletException, IOException
   {
  
	   String url="HelloWorldExample";
            // Assuming that the HelloWorldExample.class file is 
            // in the same directory as this servlet's .class file.
       response.sendRedirect(url);               
           
   } //end doPost
   
   public void doGet(HttpServletRequest request, 
     HttpServletResponse response)
     throws ServletException, IOException
   {   
         doPost(request, response);
   }
} //end class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?