B033-Servlet交互 JSP

news2024/9/21 14:34:20

目录

      • Servlet
        • Servlet的三大职责
        • 跳转:请求转发和重定向
        • 请求转发
        • 重定向
        • 汇总
        • 请求转发与重定向的区别
        • 用请求转发和重定向完善登录
      • JSP
        • 第一个JSP
          • 概述
          • 注释
          • 设置创建JSP文件默认字符编码集
        • JSP的java代码书写
        • JSP的原理
        • 三大指令
        • 九大内置对象
          • 改造动态web工程进行示例
          • 内置对象名称来源?
          • 名单列表
        • 四大作用域
          • 概述
          • 案例测试
          • 登录完善

Servlet

Servlet的三大职责

1.接受参数 --> req.getParameter (非必须)
2.处理业务 --> 拿到数据后去做一些事情(非必须)
3.跳转(必须)–> 操作完的一个结果 两句代码

跳转:请求转发和重定向

在这里插入图片描述

请求转发

案例演示:动态web项目

AServlet

@WebServlet("/go/a")
public class AServlet extends HttpServlet{
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("AServlet");
		
		String name = req.getParameter("name");
		System.out.println("A-name: "+name);
		
		req.setAttribute("password", "123456");
		
        // 请求转发
		req.getRequestDispatcher("/go/b").forward(req, resp);
	}
}

BServlet

@WebServlet("/go/b")
public class BServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("BServlet");
		
		String name = req.getParameter("name");
		System.out.println("B-name: "+name);
		
		String password = (String) req.getAttribute("password");
		System.out.println("B-password: "+password);
	}
}

浏览器访问:http://localhost/go/a?name=zhangsan

控制台:

AServlet
A-name: zhangsan
BServlet
B-name: zhangsan
B-password: 123456

req.getRequestDispatcher(“路径”).forward(request, response); ,请求里的东西,forward可以理解为携带

带值跳转,可以访问WEB-INF中资源,地址栏不改变
发送一次请求,最后一个response起作用,不可以跨域[跨网站]访问

重定向

案例演示:动态web项目

CServlet

@WebServlet("/go/c")
public class CServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("CServlet");
		
		String name = req.getParameter("name");
		System.out.println("C-name: "+name);
		
		resp.sendRedirect("/go/d");
	}
}

DServlet

@WebServlet("/go/d")
public class DServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("DServlet");
		
		String name = req.getParameter("name");
		System.out.println("D-name: "+name);
	}
}

浏览器访问:http://localhost/go/c?name=zhangsan

控制台:

CServlet
C-name: zhangsan
DServlet
D-name: null

resp.sendRedirect(“路径”) ,响应里的东西,可以有避免重复扣款和访问外部网站之类的作用

无法带值,不能访问WEB-INF下内容,地址栏改变
两次请求,起作用的依然是最后一个,可以跨域访问

汇总

在这里插入图片描述

请求转发与重定向的区别

请求转发的特点:可以携带参数,只用一次请求,可以访问WEB-INF
重定向的特点:可以避免重复扣款场景风险,可以访问外部网站,不能访问WEB-INF

请求转发过程:浏览器 - 内部代码 - WEB-INF
重定向过程:浏览器 - 内部代码 - 浏览器 - URL

动态web项目示例:
EServlet

@WebServlet("/go/e")
public class EServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("EServlet");
		
		System.out.println("E----扣款1000");
		
//		req.getRequestDispatcher("/go/f").forward(req, resp);
//		resp.sendRedirect("/go/f");
//		resp.sendRedirect("https://www.fu365.com/");
		
//		req.getRequestDispatcher("/WEB-INF/haha.html").forward(req, resp);
//		resp.sendRedirect("/WEB-INF/haha.html");
	}
}

FServlet

@WebServlet("/go/f")
public class FServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("FServlet");
	}
}

WEB-INF下新建haha.html
浏览器访问:http://localhost/go/e

用请求转发和重定向完善登录

webapp下WEB-INF外新建login.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="/loginTest" method="post">
		账号:<input type="text" name="name"><br>
		密码:<input type="password" name="password">
		<input type="submit" value="post">
	</form>
</body>
</html>

loginTest

@WebServlet("/loginTest")
public class LoginServletTest extends HttpServlet{
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		resp.setContentType("text/html;charset=utf-8");
		
		String name = req.getParameter("name");
		String password = req.getParameter("password");
		
		if ( name.equals("zhangsan") && password.equals("123456") ) {
			resp.sendRedirect("main.html");		//这里在WEB-INF外重定向可以访问
		} else {
			req.setAttribute("msg", "登录失败");
			// 需要访问另外一个servlet,把参数传进页面打印出来
			req.getRequestDispatcher("/AAAServlet").forward(req, resp);
		}
	}
}

main.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<h1>登录成功</h1>
</body>
</html>

AAAServlet

@WebServlet("/AAAServlet")
public class AAAServlet  extends HttpServlet{
  	@Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	
	  Object attribute = req.getAttribute("msg");
	  System.out.println(attribute);
	  
	  PrintWriter writer = resp.getWriter();
	  writer.print("<!DOCTYPE html>");
	  writer.print("<html>");
	  writer.print("<head>");
	  writer.print("<meta charset=\"UTF-8\">");
	  writer.print("<title>Insert title here</title>");
	  writer.print("</head>");
	  writer.print("<body>");
	  writer.print(attribute);
	  writer.print("   <form action=\"/loginTest\" method=\"post\">");
	  writer.print("     账号:<input type=\"text\" name=\"username\"><br>");
	  writer.print("     密码:<input type=\"password\" name=\"password\"><br>");
	  writer.print("     <input type=\"submit\" value=\"post\">");
	  writer.print("   </form>");
	  writer.print("</body>");
	  writer.print("</html>");
  }
}

JSP

第一个JSP
概述

servlet:是用来写java代码的,也可以用来做页面展示(把html代码一行一行打印出去),但是不擅长做页面展示。
html:用来做页面展示,静态网页,没办法拿到Java代码,不能展示数据。
jsp:看起来像html,但是它里面可以写java代码(动态网页)。

注释

webapp下新建_01hello.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	<!-- 不安全的注释,能在控制台看到 -->
	<%-- 安全的注释,不能再控制台看到 --%>
	<h1>我是第一个JSP</h1>
</body>
</html>
设置创建JSP文件默认字符编码集

JSP文件内右键 - Preferences - utf-8

JSP的java代码书写
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
    <body>
        <!-- jsp写java代码的第一种方式,打印到后端控制台 -->
            <%
                for(int i = 0;i<5;i++){
                    System.out.println("i: "+i);
                }

                int b =520;
            %>

        <!-- jsp写java代码的第二种方式,显示在页面上 -->
            <%=b %>

        <!-- jsp写java代码的第三种方式,涉及JSP的底层原理 -->
            <%!
            String ss ="abc";
            // System.out.println("abc: "+ss);
            %>
    </body>
</html>
JSP的原理

jsp需要tomcat运行才能正常展示内容
在这里插入图片描述
访问JSP - tomcat的web.xml - 两个servlet类(把JSP转化为servlet/java文件,把html代码打印出去)

tips:tomcat的web.xml是全局的,项目中的web.xml是局部的

三大指令

1.page :当前页面的一些配置,jsp生成java文件时会引用这些配置

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

2.taglib:不讲 (下一节来说 )

3.include:引用一个文件,常用于导航栏
在这里插入图片描述
_03include.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@include file="head.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div>螺旋丸</div>
</body>
</html>

_04include.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div>千年杀</div>
	<%@include file="head.jsp" %>
</body>
</html>

head.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
	<div style="background-color:red;text-align:center;font-size:50px">火影忍者</div>
九大内置对象
改造动态web工程进行示例

改造LoginServletTest,登录失败后跳转到login.jsp

@WebServlet("/loginTest")
public class LoginServletTest extends HttpServlet{
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		resp.setContentType("text/html;charset=utf-8");
		
		String name = req.getParameter("name");
		String password = req.getParameter("password");
		
		if ( name.equals("zhangsan") && password.equals("123456") ) {
			resp.sendRedirect("main.html");		//这里在WEB-INF外重定向可以访问
		} else {
			req.setAttribute("msg", "登录失败");
			// 需要访问另外一个servlet,把参数传进页面打印出来
//			req.getRequestDispatcher("/AAAServlet").forward(req, resp);
			req.getRequestDispatcher("login.jsp").forward(req, resp);
		}
	}
}

webapp下新增login.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%=request.getAttribute("msg") %>
	<form action="/loginTest" method="post">
		账号:<input type="text" name="name"><br>
		密码:<input type="password" name="password">
		<input type="submit" value="post">
	</form>
</body>
</html>
内置对象名称来源?

来自tomcat根据jsp生成的java文件,在那里面定义了
在这里插入图片描述

名单列表
HttpServletRequest    request  		请求对象    
HttpServletResponse   response 		响应对象
ServletConfig         config      	配置对象
ServletContext      application  
Throwable          	 exception   	异常( 你当前页面是错误页时才有 isErrorPage="true" )
JspWriter         		out    		输出流对象
Object           		page   		相当于this 是当前页的意思
PageContext         pageContext  	没好大用处 
HttpSession           session  		会话对象(重要)
四大作用域
概述
HttpServletRequest  request    一次请求
HttpSession       session      一次会话	同一个浏览器访问tomcat就是一次会话
PageContext    pageContext    	当前页面	作用不大
ServletContext   application     整个会话tomcat没有关闭就不会消失,在不同的浏览器都能拿到

在这里插入图片描述

案例测试

webapp下新增_05page.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
    pageContext.setAttribute("iampageContext","我是当前页对象");
	request.setAttribute("iamrequest", "我是请求对象");
	session.setAttribute("iamsession", "我是会话对象");
	application.setAttribute("iamapplication", "我是应用对象");
	%>
	
    <%=pageContext.getAttribute("iampageContext")
    %>
	<%=request.getAttribute("iamrequest")
	%>
	<%=session.getAttribute("iamsession")
	%>	
	<%=application.getAttribute("iamapplication")
	%>
</body>
</html>

webapp下新增_06page.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
    <%=pageContext.getAttribute("iampageContext")
    %>
	<%=request.getAttribute("iamrequest")
	%>
	<%=session.getAttribute("iamsession")
	%>	
	<%=application.getAttribute("iamapplication")
	%>
</body>
</html>

启动tomcat,浏览器访问http://localhost/_05page.jsp,我是当前页对象 我是请求对象 我是会话对象 我是应用对象

浏览器访问http://localhost/_06page.jsp,null null 我是会话对象 我是应用对象

换一个浏览器访问http://localhost/_06page.jsp,null null null 我是应用对象

重启原浏览器访问http://localhost/_06page.jsp,null null null 我是应用对象

重启tomcat访问http://localhost/_06page.jsp,null null null null

修改_05page.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
    pageContext.setAttribute("iampageContext","我是当前页对象");
	request.setAttribute("iamrequest", "我是请求对象");
	session.setAttribute("iamsession", "我是会话对象");
	application.setAttribute("iamapplication", "我是应用对象");
	%>
	
	<%
	request.getRequestDispatcher("_06page.jsp").forward(request, response);
	%>
</body>
</html>

启动tomcat,浏览器访问http://localhost/_05page.jsp,null 我是请求对象 我是会话对象 我是应用对象

修改_05page.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
    pageContext.setAttribute("iampageContext","我是当前页对象");
	request.setAttribute("iamrequest", "我是请求对象");
	session.setAttribute("iamsession", "我是会话对象");
	application.setAttribute("iamapplication", "我是应用对象");
	%>
	
	<%
	//request.getRequestDispatcher("_06page.jsp").forward(request, response);
	response.sendRedirect("_06page.jsp");
	%>
</body>
</html>

启动tomcat,浏览器访问http://localhost/_05page.jsp,null null 我是会话对象 我是应用对象

修改_06page.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
    <%=pageContext.getAttribute("iampageContext")
    %>
	<%=request.getAttribute("iamrequest")
	%>
	<%=session.getAttribute("iamsession")
	%>	
	<%=application.getAttribute("iamapplication")
	%>
	
	<%
	request.getRequestDispatcher("_05page.jsp").forward(request, response);
	%>
</body>
</html>

启动tomcat,浏览器访问http://localhost/_05page.jsp,报错:该网页无法正常运作,localhost将您重定向的次数过多。

登录完善

改造login.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isErrorPage="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
	if(request.getAttribute("msg")!=null){ %>
	<%=request.getAttribute("msg") %>
	<%} %>
	<form action="/loginTest" method="post">
		账号:<input type="text" name="name"><br>
		密码:<input type="password" name="password">
		<input type="submit" value="post">
	</form>
</body>
</html>

LoginServletTest设置数据到session作用域

@WebServlet("/loginTest")
public class LoginServletTest extends HttpServlet{
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		ServletContext servletContext = req.getServletContext();
		HttpSession session = req.getSession();
		
		
		req.setCharacterEncoding("UTF-8");
		resp.setContentType("text/html;charset=utf-8");
		
		String name = req.getParameter("name");
		String password = req.getParameter("password");
		
		if ( name.equals("zhangsan") && password.equals("123456") ) {
			session.setAttribute("name", "zhangsan");
			resp.sendRedirect("main.jsp");		//这里在WEB-INF外重定向可以访问
		} else {
			req.setAttribute("msg", "登录失败");
			// 需要访问另外一个servlet,把参数传进页面打印出来
//			req.getRequestDispatcher("/AAAServlet").forward(req, resp);
			req.getRequestDispatcher("login.jsp").forward(req, resp);
		}
	}
}

新建main.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
恭喜你登录成功<%=session.getAttribute("name")%>
</body>
</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1245317.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

关于elementui和ant design vue无法禁止浏览器自动填充问题

以and design vue 为例&#xff1a; 图标用来显隐账号密码 html&#xff1a; <a-form-model-item label"账号密码:" prop"password"><a-input v-if"passwordTab" ref"passwordInput" v-model"form.password" typ…

如何进行MySQL的主从复制(MySQL5.7)

背景&#xff1a;在一些Web服务器开发中&#xff0c;系统用户在进行数据访问时&#xff0c;基本都是直接操作数据库MySQL进行访问&#xff0c;而这种情况下&#xff0c;若只有一台MySQL服务器&#xff0c;可能会存在如下问题 数据的读和写的所有压力都会由一台数据库独…

利用STM32CubeMX解读时钟树

1&#xff0c;低速时钟 LSE是外部晶振作时钟源&#xff0c;主要提供给实时时钟模块&#xff0c;所以一般采用32.768KHz。LSI是由内部RC振荡器产生&#xff0c;也主要提供给实时时钟模块&#xff0c;频率大约为40KHz。(LSE和LSI)只是提供给芯片中的RTC(实时时钟)及IWDG(独立看门…

【大数据】Docker部署HMS(Hive Metastore Service)并使用Trino访问Minio

本文参考链接置顶&#xff1a; Presto使用Docker独立运行Hive Standalone Metastore管理MinIO&#xff08;S3&#xff09;_hive minio_BigDataToAI的博客-CSDN博客 一. 背景 团队要升级大数据架构&#xff0c;需要摒弃hadoop&#xff0c;底层使用Minio做存储&#xff0c;应用…

ebpf实战(一)-------监控udp延迟

问题背景: 为了分析udp数据通信中端到端的延迟,我们需要对整个通信链路的每个阶段进行监控,找出延迟最长的阶段. udp接收端有2个主要路径 1.数据包到达本机后&#xff0c;由软中断处理程序将数据包接收并放入udp socket的接收缓冲区 数据接收流程 2. 应用程序调用recvmsg等a…

MySQL数据库_01

Web后端开发_02 数据库介绍 什么是数据库&#xff1f; 数据库&#xff1a;DataBase&#xff08;DB&#xff09;&#xff0c;是存储和管理数据的仓库 数据库管理系统&#xff1a;DataBase Management System (DBMS)&#xff0c;操纵和管理数据库的大型软件。SQL&#xff1a;St…

Node.js入门指南(二)

目录 http模块 创建http服务端 浏览器查看 HTTP 报文 获取 HTTP 请求报文 设置响应报文 网页资源的基本加载过程 静态资源服务 hello,大家好&#xff01;上一篇文章我们对Node.js进行了初步的了解&#xff0c;并介绍了Node.js的Buffer、fs模块以及path模块。这一篇文章主…

51单片机应用从零开始(八)·循环语句(for循环、while 语句、do‐while 语句)

51单片机应用从零开始&#xff08;七&#xff09;循环语句&#xff08;if语句&#xff0c;swtich语句&#xff09;-CSDN博客 目录 1. 用for 语句控制蜂鸣器鸣笛次数 2. 用while 语句控制 LED 3. 用 do‐while 语句控制 P0 口 8 位 LED 流水点亮 1. 用for 语句控制蜂鸣器鸣笛…

6.3.WebRTC中的SDP类的结构

在上节课中呢&#xff0c;我向你介绍了sdp协议&#xff0c; 那这节课呢&#xff0c;我们再来看看web rtc中。是如何存储sdp的&#xff1f;也就是sdp的类结构&#xff0c;那在此之前呢&#xff1f;我们先对sdp的内容啊&#xff0c;做一下分类。因为在上节课中呢&#xff0c;虽然…

jetpack的简单使用

Jetpack ViewModel&#xff1a; 什么是ViewModel&#xff1f; ViewModel 是 Android 架构组件的一部分&#xff0c;用于帮助开发者管理 UI 数据的持久性和生命周期感知。ViewModel 的主要目的是将 UI 数据与界面控制逻辑分离&#xff0c;以便更好地管理数据的生命周期&#…

佳易王早点点餐快餐店点单软件会员管理系统教程

佳易王早点点餐快餐店点单软件会员管理系统教程 软件特色&#xff1a; 1、功能实用&#xff0c;操作简单&#xff0c;不会电脑也会操作&#xff0c;软件免安装&#xff0c;已内置数据库。软件在关闭的时候&#xff0c;可以设置会员数据备份到U盘&#xff0c;数据本机备份一份&…

基于SSM安全生产培训管理平台设计与实现 毕业设计源码26918

赠送源码-毕业设计&#xff1a;SSM 安全生产培训平台https://www.bilibili.com/video/BV1gH4y1z7c6/?vd_source72970c26ba7734ebd1a34aa537ef5301 目录 摘 要 Abstract 第1章 前 言 1.1 研究背景 1.2 研究现状 1.3 系统开发目标 第2章 系统开发环境 2.1 JAVA简介…

uniapp 使用Highcharts,多色曲线,多色阴影,百分比,网格等处理,accessibility.js提示错误处理

示例图 1.安装Highcharts npm install highcharts --save npm install highcharts-vue2.demo代码 <template><view class"charts-main"><view id"charts" style"width: 90%;height: 460rpx;"></view></view>&l…

OpenHarmony之NAPI框架介绍

张志成 诚迈科技高级技术专家 NAPI是什么 NAPI的概念源自Nodejs&#xff0c;为了实现javascript脚本与C库之间的相互调用&#xff0c;Nodejs对V8引擎的api做了一层封装&#xff0c;称为NAPI。可以在Nodejs官网&#xff08;https://nodejs.org/dist/latest-v20.x/docs/api/n-api…

SSM家具个性定制管理系统开发mysql数据库web结构java编程计算机网页源码eclipse项目

一、源码特点 SSM 家具个性定制管理系统是一套完善的信息系统&#xff0c;结合springMVC框架完成本系统&#xff0c;对理解JSP java编程开发语言有帮助系统采用SSM框架&#xff08;MVC模式开发&#xff09;&#xff0c;系统具有完整的源代码和数据库&#xff0c;系统主要采用…

STM32电容触摸按键检测

STM32电容触摸按键检测 电容触摸按键简介检测原理 CubeMX配置代码展示&讲解TPAD.cTPAD.h 本期内容我们将学习电容触摸按键的检测原理。以及代码实现思路 电容触摸按键 简介 电容触摸按键依赖的是电容的充放电相对于机械按键更加耐用&#xff0c;不容易受外界环境干扰在我们…

mybatis注解方式动态标签时有特殊符号,出现元素内容必须由格式正确的字符数据或标记组成

原始代码demo Select("SELECT COUNT(1) FROM AAAA WHERE name #{nage} AND age< 4") public Integer sumXxxxx(String nage, String age);现需求改为nage可以为空&#xff0c;因此使用了动态拼接 Select("<script> SELECT COUNT(1) FROM AAAA WHERE …

ruoyi-plus使用Statistic统计组件升级element-plus

原本使用的就是gitee上lionli的ruoyi-plus版本的代码。但是在使用过程中作首页数据看板时想使用elementui的Statistic统计组件。结果在浏览器控制台报错找不到组件el-statistic 于是查看elementui的历史版本&#xff0c;发现是在新版中才有这个组件&#xff0c;旧版本是没这个组…

常见树种(贵州省):012茶、花椒、八角、肉桂、杜仲、厚朴、枸杞、忍冬

摘要&#xff1a;本专栏树种介绍图片来源于PPBC中国植物图像库&#xff08;下附网址&#xff09;&#xff0c;本文整理仅做交流学习使用&#xff0c;同时便于查找&#xff0c;如有侵权请联系删除。 图片网址&#xff1a;PPBC中国植物图像库——最大的植物分类图片库 一、茶 灌…

读像火箭科学家一样思考笔记07_探月思维

1. 挑战“不可能”的科学与企业 1.1. 互联网 1.1.1. 和电网一样具有革命性&#xff0c;一旦你插上电源&#xff0c;就能让自己的生活充满活力 1.1.2. 互联网的接入可以帮助人们摆脱贫困&#xff0c;拯救生命 1.1.3. 互联网还可以提供与天气相关的信息 1.2. 用廉价、可靠的…