Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

关于这个问题的解决方法,网上一搜很多,大部分都是说加入jstl,和standard,

<dependency>
	<groupId>jstl</groupId>
	<artifactId>jstl</artifactId>
	<version>1.2</version>
</dependency>
<dependency>
	<groupId>taglibs</groupId>
	<artifactId>standard</artifactId>
	<version>1.1.2</version>
</dependency>

再有就是说jstl1.0和2.0的时候,对于引用时uri区别

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

2.0的时候,uri =http://java.sun.com/jsp/jstl/core

1.0的时候,uri =http://java.sun.com/jstl/core

还有2.0的时候,web.xml中 use servlet specification at least 2.4 in your web.xml.,也就是说至少是2.4,比如用下面的3.0

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
 

如果以上方式都试过了,还是报错,怎么办?从https://stackoverflow.com/questions/50833502/jsp-error-can-not-find-the-tag-library-descriptor-for-http-java-sun-com-jsp 找到如下解决办法:

So I found the answer myself. I didn't have to change my POM or anything at all. What I had to do was to activate the Project Facets and select Tomcat as runtime.

Right Click on project -> Properties -> Project Facets -> Check: Dynamic Web Module, Java and JavaScript -> Hit the Runtimes tab on the right and check Tomcat server

This solved a few errors already. 走到这一步,我的错误就已经解决了。

原文中还有后面一步,处理那些可能项目maven配置有问题的,复制下来,供参考

The last part was to deploy the maven dependencies with the project. For this you will have to go to:

Right Click on project -> Properties -> Deployment Assembly -> Add... -> Java Build Path Entries -> Select (all) entries and hit Finish

Those were the steps I had to take to run my web project properly

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值