首页 > Web开发 > 详细

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

时间:2014-09-17 23:06:52      阅读:361      评论:0      收藏:0      [点我收藏+]
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");
}
    
}

 

 

bubuko.com,布布扣bubuko.com,布布扣

 

bubuko.com,布布扣

 

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

 

bubuko.com,布布扣

 

 

 

bubuko.com,布布扣

 

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

原文:http://www.cnblogs.com/fantasy12436109/p/3978167.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!