servlet:dopost和doget

servlet: page jump

Steps for usage

  1. Create a web project
  2. Jump way
    1. get method
      1. Adding page content and path index.xml
      2. Add servlet package in src, adding hellpservlet method inherited from httpservlet, write doget function
      3. Add two labels servlet in web.xml inside
        1. servlet, i.e. adding servlet-name and the method name servlet-class i.e. path method (for Methods)
        2. servlet-mapping, i.e. adding servlet-name and the method name url-partten Page path i.e., a path the same as step

     Similarly to the above method 2.post

          1. Modify index.xml

 

          2. Add dopost method

      

Guess you like

Origin www.cnblogs.com/bebox/p/11094003.html