2014-9-17二班----10 web project

package cn.rwkj.servlet;

import java.io.IOException;

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

public class IndexServlet extends HttpServlet{
    
public void    doGet(HttpServletRequest re,HttpServletResponse res) throws ServletException, IOException{
    
System.out.println("odget");

String name = re.getParameter("name");
String pwd = re.getParameter("pwd") ;

System.out.println("name:" + name + " pwd: "+ pwd);


//re.getRequestDispatcher("index.jsp").forward(re, res);
res.sendRedirect("index.jsp");
}

public void doPost(HttpServletRequest re,HttpServletResponse res){
    System.out.println("odget");
}
    
}

 

 

 

 

  http://localhost:8080/rwkj1/indexServlet     转       http://localhost:8080/rwkj1/index.jsp

 

 

 

 

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。