JavaWeb笔记_JSTL标签库JavaEE三层架构案例

一.JSTL标签库

1.1 JSTL概述

 JSTL(jsp standard tag library):JSP标准标签库,它是针对EL表达式一个扩展,通过JSTL标签库与EL表达式结合可以完成更强大的功能
   JSTL它是一种标签语言,JSTL不是JSP内置标签
   JSTL标签库主要包含:
     ****核心标签
         格式化标签
         SQL标签
         XML标签
         JSTL函数

1.2 JSTL标签库引入

a.JSTL如果要使用需要引入两个jar包:jstl.jar,standard.jar
      b.我们在JSP中手动引入核心标签库
         prefix:前缀(别名)
         uri:uri指定的路径中定义了这些核心标签
         <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

1.3 if标签

<%--test属性中写即将做判断的EL表达式
        如果test属性中EL表达式最终结果为true,将执行if标签中的内容
        --%> 

 

<%@ page import="bean.Person" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head><title>JSTL标签if标签的使用</title>
</head>
<body><%request.setAttribute("p1",new Person(18,"male"));request.setAttribute("p2",new Person(20,"man"));%><c:if test="${!empty p1}">login success</c:if><br><c:if test="${!empty p2}">${p2.age}岁性别${p2.gender} login success</c:if><br><c:if test="${empty p2.name && p2.gender=='man'}">${p2.age}</c:if>
</body>
</html>

1.4 forEach标签

 <%--forEach标签遍历List集合
            items:通过EL表达式取出遍历的集合对象
            var:把每次遍历到的对象,以及var对应值存储到pageContext域中
                例如:var="user" pageContext.setAttribute("user",每次遍历到对象)
          --%>
        <%--var:当遍历map时,每次把遍历到entry对象(封装着key=value)存储到pageContext域--%>
            <%--    例如:var="entry" pageContext.setAttribute("entry",每次遍历到的entry对象)--%>

<%@ page import="bean.Person" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="java.util.HashMap" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>forEach标签使用</title>
</head>
<body><%//list集合List<Person> peoples = Arrays.asList(new Person("张三", 18, "man"),new Person("李四", 20, "male"));request.setAttribute("peoples", peoples);//map集合HashMap<String, Person> map = new HashMap<>();map.put("张三", new Person(18, "man"));map.put("001", new Person(20, "male"));session.setAttribute("map", map);%><c:if test="${!empty peoples}"><c:forEach items="${peoples}" var="people">${people.name},${people.age},${people.gender}<br></c:forEach></c:if><c:if test="${!empty map}"><c:forEach items="${map}" var="entry">${entry.key},${entry.value.age},${entry.value.gender}<br></c:forEach></c:if>
</body>
</html>

二.JavaEE三层架构

   web层:JSP/Servlet 主要用于显示数据以及接收客户端的数据
  service层:主要负责业务处理,存放业务逻辑相关的代码(数据验证,事务处理..)
  dao层:负责跟数据库打交道,负责数据库访问,操作数据库相关代码

 

三.登录案例

 web层

//登录判断
@WebServlet("/loginServlet")
public class loginServlet extends HttpServlet {@Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {doPost(request, response);}@Overrideprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {//获取表单传过来的参数,并将参数封装为对象String username = request.getParameter("username");String password = request.getParameter("password");//将用户输入的用户名和密码封装成User对象User user = new User(username, password);//最终在数据库中查询到的User对象User finalyUser = UserServlet.getFinalyUser(user);//判断finalyUser,若为空,则在数据库中查询不到,登录失败,反之登录成功if (finalyUser!=null){request.setAttribute("statusCode",100);request.setAttribute("msg","登录成功");//将正确的user用户信息存储在session域中request.getSession().setAttribute("user",finalyUser);}else {request.setAttribute("statusCode",101);request.setAttribute("msg","用户名或密码错误");//将来在页面回显用户输入的错误信息,方便用户进行修改request.setAttribute("user",user);}//转发到login页面,与login页面公用相同的request,response对象,方便回显信息request.getRequestDispatcher("/login.jsp").forward(request,response);}
}
//注销
@WebServlet("/loginoutServlet")
public class loginoutServlet extends HttpServlet {@Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {doPost(request, response);}@Overrideprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {//注销request.getSession().invalidate();response.sendRedirect(request.getContextPath()+"/index.jsp");}
}

service层

//将dao层返回的User对象返回给web层
public class UserServlet  {public static User getFinalyUser(User user){return Userdao.queryUser(user);}
}

dao层

//对数据库进行查询
public class Userdao {User user=null;public static User queryUser(User user) {QueryRunner qr = new QueryRunner(JDBCUtils.getDataSource());User queryuser;try {queryuser = qr.query("SELECT * FROM user WHERE username=? and password=?",new BeanHandler<>(User.class), user.getUsername(), user.getPassword());} catch (SQLException e) {throw new RuntimeException(e);}return queryuser;}
}

Utils工具包

public class JDBCUtils {/*构造函数私有化不允许在类外创建对象*/private JDBCUtils() {}private static BasicDataSource bs;static {Properties properties = new Properties();InputStream is = JDBCUtils.class.getClassLoader().getResourceAsStream("db.properties");try {/*从流中将配置文件中的数据加载到集合中*/properties.load(is);//创建一个连接池bs = new BasicDataSource();//设置连接池参数/*必备的四个参数*/bs.setDriverClassName(properties.getProperty("DRIVER"));bs.setUrl(properties.getProperty("URL"));bs.setUsername(properties.getProperty("USER"));bs.setPassword(properties.getProperty("PASSWORD"));/*设置可选参数*/bs.setInitialSize(12);bs.setMaxTotal(12);bs.setMaxIdle(2);bs.setMinIdle(1);bs.setMaxWaitMillis(30000);} catch (Exception e) {e.printStackTrace();}}public static Connection getConnection() {Connection con=null;//提升作用域try {con=bs.getConnection();} catch (SQLException e) {e.printStackTrace();}return con;}public static DataSource getDataSource() {return bs;}
}

登录界面(利用bootstrap框架)

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content=""><meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"><meta name="generator" content="Jekyll v4.1.1"><title>Signin Template · Bootstrap</title><link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css"><script src="${pageContext.request.contextPath}/js/jquery-3.4.1.min.js"></script><script src="${pageContext.request.contextPath}/js/bootstrap.bundle.min.js"></script><script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script><link rel="canonical" href="https://getbootstrap.com/docs/4.5/examples/sign-in/"><!-- Bootstrap core CSS --><link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet"><script>window.onload = function () {<c:if test="${!empty statusCode && statusCode==100}">$('#success').modal('show');//将指定id的模态框弹出window.setTimeout("window.location.href='${pageContext.request.contextPath}/index.jsp'",2000)</c:if>};</script><style>.bd-placeholder-img {font-size: 1.125rem;text-anchor: middle;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}@media (min-width: 768px) {.bd-placeholder-img-lg {font-size: 3.5rem;}}</style><!-- Custom styles for this template --><link href="${pageContext.request.contextPath}/css/signin.css" rel="stylesheet">
</head>
<body class="text-center">
<form class="form-signin" action="${pageContext.request.contextPath}/loginServlet" method="post"><img class="mb-4" src="${pageContext.request.contextPath}/img/bootstrap-solid.svg" alt="" width="72" height="72"><h1 class="h3 mb-3 font-weight-normal">请登录</h1><c:if test="${empty statusCode || statusCode==100}"><label for="inputUsername" class="sr-only">用户名</label> <!-- 修改label的for属性和文本 --><input type="text" name="username" id="inputUsername" class="form-control" placeholder="Username" required autofocus> <!-- 修改input的type和placeholder --></c:if><c:if test="${!empty statusCode && statusCode!=100}"><label for="inputUsername" class="sr-only">用户名</label> <!-- 修改label的for属性和文本 --><input type="text" id="inputUsername" name="username" value="${user.username}" class="form-control is-invalid" placeholder="Username" required autofocus> <!-- 修改input的type和placeholder --></c:if><c:if test="${empty statusCode || statusCode==100}"><label for="inputPassword" class="sr-only">密码</label><input type="password" id="inputPassword" name="password" class="form-control" placeholder="Password" required></c:if><c:if test="${!empty statusCode && statusCode!=100}"><label for="inputPassword" class="sr-only">密码</label><input type="password" id="inputPassword" name="password" value="${user.password}" class="form-control is-invalid" placeholder="Password" required><div class="invalid-feedback">${msg}</div></c:if><%--弹出框--%><div class="modal fade" id="success" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-body">${msg}!正在进入首页</div></div></div></div><div class="checkbox mb-3"><label><input type="checkbox" value="remember-me"> 记住我</label></div><button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
</form>
</body>
</html>

 主界面(利用bootstrap框架)

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content=""><meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"><meta name="generator" content="Jekyll v4.1.1"><title>Blog Template · Bootstrap</title><link rel="canonical" href="https://getbootstrap.com/docs/4.5/examples/blog/"><!-- Bootstrap core CSS --><link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet"><style>.bd-placeholder-img {font-size: 1.125rem;text-anchor: middle;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}@media (min-width: 768px) {.bd-placeholder-img-lg {font-size: 3.5rem;}}</style><!-- Custom styles for this template --><link href="https://fonts.googleapis.com/css?family=Playfair+Display:700,900" rel="stylesheet"><!-- Custom styles for this template --><link href="${pageContext.request.contextPath}/css/blog.css" rel="stylesheet">
</head>
<body>
<div class="container"><header class="blog-header py-3"><div class="row flex-nowrap justify-content-between align-items-center"><div class="col-4 pt-1"><a class="text-muted" href="#">Subscribe</a></div><div class="col-4 text-center"><a class="blog-header-logo text-dark" href="#">Large</a></div><c:if test="${!empty user}"><div class="col-4 d-flex justify-content-end align-items-center"><a class="text-muted" href="#" aria-label="Search"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="mx-3" role="img" viewBox="0 0 24 24" focusable="false"><title>Search</title><circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2"/></svg></a><a href="#" class="btn btn-sm btn-outline-secondary">${user.username}</a><a class="btn btn-sm btn-outline-secondary" href="${pageContext.request.contextPath}/loginoutServlet">Sign out</a></div></c:if><c:if test="${empty user}"><div class="col-4 d-flex justify-content-end align-items-center"><a class="text-muted" href="#" aria-label="Search"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="mx-3" role="img" viewBox="0 0 24 24" focusable="false"><title>Search</title><circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2"/></svg></a><a class="btn btn-sm btn-outline-secondary" href="${pageContext.request.contextPath}/login.jsp">Sign up${statusCode}</a></div></c:if></div></header><div class="nav-scroller py-1 mb-2"><nav class="nav d-flex justify-content-between"><a class="p-2 text-muted" href="#">World</a><a class="p-2 text-muted" href="#">U.S.</a><a class="p-2 text-muted" href="#">Technology</a><a class="p-2 text-muted" href="#">Design</a><a class="p-2 text-muted" href="#">Culture</a><a class="p-2 text-muted" href="#">Business</a><a class="p-2 text-muted" href="#">Politics</a><a class="p-2 text-muted" href="#">Opinion</a><a class="p-2 text-muted" href="#">Science</a><a class="p-2 text-muted" href="#">Health</a><a class="p-2 text-muted" href="#">Style</a><a class="p-2 text-muted" href="#">Travel</a></nav></div><div class="jumbotron p-4 p-md-5 text-white rounded bg-dark"><div class="col-md-6 px-0"><h1 class="display-4 font-italic">Title of a longer featured blog post</h1><p class="lead my-3">Multiple lines of text that form the lede, informing new readers quickly and efficiently about what’s most interesting in this post’s contents.</p><p class="lead mb-0"><a href="#" class="text-white font-weight-bold">Continue reading...</a></p></div></div><div class="row mb-2"><div class="col-md-6"><div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"><div class="col p-4 d-flex flex-column position-static"><strong class="d-inline-block mb-2 text-primary">World</strong><h3 class="mb-0">Featured post</h3><div class="mb-1 text-muted">Nov 12</div><p class="card-text mb-auto">This is a wider card with supporting text below as a natural lead-in to additional content.</p><a href="#" class="stretched-link">Continue reading</a></div><div class="col-auto d-none d-lg-block"><svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Thumbnail"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg></div></div></div><div class="col-md-6"><div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"><div class="col p-4 d-flex flex-column position-static"><strong class="d-inline-block mb-2 text-success">Design</strong><h3 class="mb-0">Post title</h3><div class="mb-1 text-muted">Nov 11</div><p class="mb-auto">This is a wider card with supporting text below as a natural lead-in to additional content.</p><a href="#" class="stretched-link">Continue reading</a></div><div class="col-auto d-none d-lg-block"><svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Thumbnail"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg></div></div></div></div>
</div><main role="main" class="container"><div class="row"><div class="col-md-8 blog-main"><h3 class="pb-4 mb-4 font-italic border-bottom">From the Firehose</h3><div class="blog-post"><h2 class="blog-post-title">Sample blog post</h2><p class="blog-post-meta">January 1, 2014 by <a href="#">Mark</a></p><p>This blog post shows a few different types of content that’s supported and styled with Bootstrap. Basic typography, images, and code are all supported.</p><hr><p>Cum sociis natoque penatibus et magnis <a href="#">dis parturient montes</a>, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Cras mattis consectetur purus sit amet fermentum.</p><blockquote><p>Curabitur blandit tempus porttitor. <strong>Nullam quis risus eget urna mollis</strong> ornare vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></blockquote><p>Etiam porta <em>sem malesuada magna</em> mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.</p><h2>Heading</h2><p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p><h3>Sub-heading</h3><p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p><pre><code>Example code block</code></pre><p>Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.</p><h3>Sub-heading</h3><p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p><ul><li>Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</li><li>Donec id elit non mi porta gravida at eget metus.</li><li>Nulla vitae elit libero, a pharetra augue.</li></ul><p>Donec ullamcorper nulla non metus auctor fringilla. Nulla vitae elit libero, a pharetra augue.</p><ol><li>Vestibulum id ligula porta felis euismod semper.</li><li>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</li><li>Maecenas sed diam eget risus varius blandit sit amet non magna.</li></ol><p>Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis.</p></div><!-- /.blog-post --><div class="blog-post"><h2 class="blog-post-title">Another blog post</h2><p class="blog-post-meta">December 23, 2013 by <a href="#">Jacob</a></p><p>Cum sociis natoque penatibus et magnis <a href="#">dis parturient montes</a>, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Cras mattis consectetur purus sit amet fermentum.</p><blockquote><p>Curabitur blandit tempus porttitor. <strong>Nullam quis risus eget urna mollis</strong> ornare vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></blockquote><p>Etiam porta <em>sem malesuada magna</em> mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.</p><p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p></div><!-- /.blog-post --><div class="blog-post"><h2 class="blog-post-title">New feature</h2><p class="blog-post-meta">December 14, 2013 by <a href="#">Chris</a></p><p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p><ul><li>Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</li><li>Donec id elit non mi porta gravida at eget metus.</li><li>Nulla vitae elit libero, a pharetra augue.</li></ul><p>Etiam porta <em>sem malesuada magna</em> mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.</p><p>Donec ullamcorper nulla non metus auctor fringilla. Nulla vitae elit libero, a pharetra augue.</p></div><!-- /.blog-post --><nav class="blog-pagination"><a class="btn btn-outline-primary" href="#">Older</a><a class="btn btn-outline-secondary disabled" href="#" tabindex="-1" aria-disabled="true">Newer</a></nav></div><!-- /.blog-main --><aside class="col-md-4 blog-sidebar"><div class="p-4 mb-3 bg-light rounded"><h4 class="font-italic">About</h4><p class="mb-0">Etiam porta <em>sem malesuada magna</em> mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.</p></div><div class="p-4"><h4 class="font-italic">Archives</h4><ol class="list-unstyled mb-0"><li><a href="#">March 2014</a></li><li><a href="#">February 2014</a></li><li><a href="#">January 2014</a></li><li><a href="#">December 2013</a></li><li><a href="#">November 2013</a></li><li><a href="#">October 2013</a></li><li><a href="#">September 2013</a></li><li><a href="#">August 2013</a></li><li><a href="#">July 2013</a></li><li><a href="#">June 2013</a></li><li><a href="#">May 2013</a></li><li><a href="#">April 2013</a></li></ol></div><div class="p-4"><h4 class="font-italic">Elsewhere</h4><ol class="list-unstyled"><li><a href="#">GitHub</a></li><li><a href="#">Twitter</a></li><li><a href="#">Facebook</a></li></ol></div></aside><!-- /.blog-sidebar --></div><!-- /.row --></main><!-- /.container --><footer class="blog-footer"><p>Blog template built for <a href="https://getbootstrap.com/">Bootstrap</a> by <a href="https://twitter.com/mdo">@mdo</a>.</p><p><a href="${pageContext.request.contextPath}/login.jsp">Back to top</a></p>
</footer>
</body>
</html>

最终效果

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

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

相关文章

【算法】插入区间

难度&#xff1a;中等 题目&#xff1a; 给你一个 无重叠的 &#xff0c;按照区间起始端点排序的区间列表 intervals&#xff0c;其中 intervals[i] [starti, endi] 表示第 i 个区间的开始和结束&#xff0c;并且 intervals 按照 starti 升序排列。同样给定一个区间 newInte…

leetcode面试题17.最大子矩阵

sooooooo long没刷题了&#xff0c;汗颜 题目链接&#xff1a;leetcode面试题17 1.题目 给定一个正整数、负整数和 0 组成的 N M 矩阵&#xff0c;编写代码找出元素总和最大的子矩阵。 返回一个数组 [r1, c1, r2, c2]&#xff0c;其中 r1, c1 分别代表子矩阵左上角的行号和…

Android平台轻量级RTSP服务模块二次封装版调用说明

技术背景 在前面的blog&#xff0c;我们发布了Android平台轻量级RTSP服务模块的技术对接说明&#xff0c;好多开发者希望&#xff0c;更黑盒的对接轻量级RTSP服务这块&#xff0c;专注于自身业务逻辑。为此&#xff0c;我们针对Android平台轻量级RTSP服务模块&#xff0c;做了…

解析capl文件生成XML Test Module对应的xml工具

之前一直用的CAPL Test Module来写代码&#xff0c;所有的控制都是在MainTest()函数来实现的&#xff0c;但是有一次&#xff0c;代码都写完了&#xff0c;突然需要用xml的这种方式来实现&#xff0c;很突然&#xff0c;之前也没研究过&#xff0c;整理这个xml整的一身汗&#…

【Nacos】微服务注册在不同的group上,支持跨group服务发现,二次开发

Nacos具备微服务注册和发现&#xff0c;以及配置管理的功能&#xff0c;本文详情描述【注册和发现】的原理&#xff0c;以及基本使用&#xff0c;包括如何进行跨group注册和发现。 一、Nacos配置spring:cloud:nacos:discovery:server-addr: nacosIP地址:8849namespace: devgro…

无人机飞行姿态俯仰、横滚、偏航、油门详解

无人机飞行姿态涉及其在空中的空间位置和方向。飞行姿态控制的精确性和稳定性是无人机实现自主飞行和完成任务的关键。无人机的飞行姿态主要通过控制其横滚、俯仰和偏航来实现。以下是对无人机飞行姿态的详细解释&#xff1a; 1. 横滚&#xff08;Roll&#xff09; 定义&…

vue中的nexttrick

Vue.js 是一个用于构建用户界面的渐进式框架&#xff0c;它允许开发者通过声明式的数据绑定来构建网页应用。在 Vue 中&#xff0c;nextTick 是一个非常重要的 API&#xff0c;它用于延迟回调的执行&#xff0c;直到下次 DOM 更新循环之后。 为什么使用 nextTick&#xff1f; …

自定义维度映射:Kylin Cube设计的高级玩法

自定义维度映射&#xff1a;Kylin Cube设计的高级玩法 在数据仓库领域&#xff0c;Apache Kylin以其高性能的分析能力而闻名。Kylin通过构建多维数据立方体&#xff08;Cube&#xff09;来实现对大数据集的快速查询。Cube设计中的维度映射是优化查询性能的关键环节。本文将探讨…

vue3前端开发-小兔鲜项目-登录组件的开发表单验证

vue3前端开发-小兔鲜项目-登录组件的开发表单验证&#xff01;现在开始写登录页面的内容。首先这一次完成基础的首页按钮点击跳转&#xff0c;以及初始化一些简单的表单的输入验证。后期还会继续完善内容。 1&#xff1a;首先还是准备好login页面的组件代码内容。 <script …

企业风险管理的智能监控:Kompas.ai如何预警潜在风险

在企业运营中&#xff0c;风险管理是确保业务连续性和稳健发展的关键环节。随着技术的进步&#xff0c;智能风险管理成为预防损失和识别潜在风险的重要手段。Kompas.ai&#xff0c;作为一款先进的智能监控工具&#xff0c;正通过数据分析和模式识别技术&#xff0c;帮助企业实现…

《华为数据之道》读书笔记六---面向自助消费的数据服务建设

七、从结果管理到过程管理&#xff0c; 从能“看”到能“管” 1、数据赋能业务运营 数字化运营旨在利用数字化技术获取、管理和分析数据&#xff0c;从而为企业的战略决策与业务运营提供可量化的、科学的支撑。 数字化运营归根结底是运营&#xff0c;旨在推动运营效率与能力的…

【第三天】计算机网络 HTTP请求中常见的状态码 什么是强缓存和协商缓存

HTTP请求中常见的状态码 前面不是说过了HTTP的请求报文和响应报文吗&#xff1f; 状态码不就是响应报文里才有的吗。 同时响应报文的第一行包含了协议版本&#xff0c;状态码以及描述。 状态码有以下这几个类别&#xff1a; 状态码类别含义1XXinformation(信息性状态码&#…

基站光伏直流叠光能效管理方案

安科瑞 华楠 基站现状和趋势 5G基站是专门提供5G网络服务的公用移动通信基站。5G基站主要用于提供5G空口协议功能&#xff0c;支持与用户设备、核心网之间的通信。按照逻辑功能划分&#xff0c;5G基站可分为5G基带单元与5G射频单元&#xff0c;二者之间可通过CPRI或eCPRI接口…

AFSim仿真系统-架构概览

引言 本文档从最终用户的角度描述了AFSIM架构&#xff0c;旨在帮助最终用户深入了解AFSIM的操作概念。 核心架构 AFSIM基于面向对象的C架构&#xff0c;提供了一种可扩展和模块化的架构&#xff0c;使得许多附加功能能够轻松集成。AFSIM允许新的组件模型&#xff08;如传感器、…

vue3.0学习笔记(二)——生命周期与响应式数据(ref,reactive,toRef,toRefs函数)

1. 组合API-setup函数 使用细节&#xff1a; setup 是一个新的组件选项&#xff0c;作为组件中使用组合API的起点。从组件生命周期来看&#xff0c;它的执行在组件实例创建之前vue2.x的beforeCreate执行。这就意味着在setup函数中 this 还不是组件实例&#xff0c;this 此时是…

SpringBoot 实现图形验证码

一、最终结果展示 二、前端代码 2.1 index.html <!DOCTYPE html> <html lang"en"><head><meta charset"utf-8"><title>验证码</title><style>#inputCaptcha {height: 30px;vertical-align: middle;}#verifica…

交易积累-BR

BR指标&#xff0c;全称是“买卖意愿比率”&#xff08;Bull/Bear Ratio&#xff09;&#xff0c;是一个衡量市场买卖力量对比的技术分析工具。BR指标是由中国的技术分析师发展起来的&#xff0c;它通过比较股票或市场在一定时间内的上涨能量与下跌能量来评估市场情绪和潜在的趋…

【AI大模型】使用AI大模型进行企业数据分析与决策支持

前言 ChatGPT4相比于ChatGPT3.5,有着诸多不可比拟的优势&#xff0c;比如图片生成、图片内容解析、GPTS开发、更智能的语言理解能力等&#xff0c;但是在国内使用GPT4存在网络及充值障碍等问题&#xff0c;如果您对ChatGPT4.0感兴趣&#xff0c;可以私信博主为您解决账号和环境…

自动驾驶(八十八)---------通讯之SOMEIP

1. 什么是SOME/IP 服务导向架构&#xff08;SOA&#xff0c;Service-Oriented Architecture&#xff09;是一种设计软件系统的方法&#xff0c;强调通过可重用的服务来实现系统的松散耦合。每个服务是独立的功能单元&#xff0c;可以被不同的应用程序使用。这些服务通过标准化的…

【Vue】vue两个核心功能声明式渲染_响应式

1、简介 Vue.js 是一个渐进式JavaScript框架&#xff0c;用于构建用户界面。它以其易用性、灵活性和高效性而闻名。Vue 的两个核心功能是声明式渲染和响应式系统&#xff0c;这两个功能共同为开发者提供了强大的工具来构建动态且响应式的Web应用。 2、声明式渲染 2.1简介 声…