六祎:HttpServlet实操

 

1.Httpserevlet时序图

课时7:https://edu.aliyun.com/lesson_1700_13646#_13646

2.HttpServlet原理 

3.FServlet.java

创建一个FServlet类,继承Httpservlet类

package cn.lystudio.web.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 EServlet extends HttpServlet {


    //doPost
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) 
	throws ServletException, IOException {
		
		
	}
	

}

 

3.1新建一个login.html

<!DOCTYPE html>
<html>
  <head>
    <title>login.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body>
    This is my HTML page. <br>
    //action="/包名/(<url-pattern>/EServlet</url-pattern>)中的"/Eservlet"
    //action="/01_sevlet/EServlet"
    <form action="/01_sevlet/EServlet" method="post">
    <input name="name" type="text"><br>
    <input name="passwd" type="text"><br>
    <input type="submit" value="submit">
    </form>
  </body>
</html>

 

恭喜,你已完成实操演练!

 

 

 

posted @ 2022-04-26 00:55  你好,Alf  阅读(2)  评论(0编辑  收藏  举报