servlet:dopost和doget

servlet:页面跳转

使用步骤

  1. 创建web项目
  2. 跳转方式
    1. get方法
      1. 在index.xml添加页面内容和路径
      2. 在src添加servlet包,加入hellpservlet方法继承于httpservlet,编写doget函数
      3. 在web.xml里面添加servlet两个标签
        1. servlet,添加servlet-name即方法名和servlet-class即方法路径(包.方法)
        2. servlet-mapping,添加servlet-name即方法名和url-partten即页面路径,与步骤1路径相同

     2.post方法与上面同理

          1.修改index.xml

          2.添加dopost方法

      

猜你喜欢

转载自www.cnblogs.com/bebox/p/11094003.html