jsp—MacOS下配置Tomcat和JSTL

一、配置Tomcat

首先去官网下载Tomcat,最好是8版本

https://tomcat.apache.org/download-80.cgi

image-20230625213814064

然后打开idea

image-20230625214404029 image-20230625214456361 image-20230625214523984

二、配置jstl

首先去官网下载

http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/

image-20230625214731603

下载之后,在idea的项目工程下,新建一个lib文件夹

image-20230625214812327

然后,将刚才下载的包的lib下的image-20230625214855264

image-20230625214924926

将这两个jar包复制到lib下。

然后配置一下项目

image-20230625215014918 image-20230625215038511

最后,将刚才的lib包(只是lib包)加入到依赖里:

image-20230625215126457

三、jstl

<%--
  Created by IntelliJ IDEA.
  User: haoran
  Date: 2023/6/25
  Time: 21:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--通过taglib标签引入所需要的库--%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <c:if test="${1==1}">
        hello world
    </c:if>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_45864704/article/details/131386840