0
点赞
收藏
分享

微信扫一扫

六祎:HttpServlet实操

weednoah 2022-08-26 阅读 36


 

1.Httpserevlet时序图

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

六祎:HttpServlet实操_java

2.HttpServlet原理 

六祎:HttpServlet实操_css_02

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>

 

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

 

 

 

举报

相关推荐

0 条评论