JSP_指令_include&taglib指令和JSP_注释

  • include:页面包含的。导入页面的资源文件
    • <%@include file="top.jsp"%>
  • taglib:导入资源
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" errorPage="500.jsp" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%

    %>
<c:forEach var="">
    
</c:forEach>
</body>
</html>

注释:

  • html注释:
    • :只能注释html代码片段
  • jsp注释:
    • <%----%>:可以注释所有
<%--
  Created by IntelliJ IDEA.
  User: lihaiyang
  Date: 2022/8/16
  Time: 9:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="top.jsp"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <!-- <h3>主体信息</h3> -->

    <!--
    <%
        System.out.println("你好");
    %>
    -->

    <%--
        <%
        System.out.println("你也好");
        %>
    --%>
</body>
</html>

posted @ 2022-08-16 09:36  我滴妈老弟  阅读(23)  评论(0编辑  收藏  举报