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

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


	jstl
	jstl
	1.2


	taglibs
	standard
	1.1.2

再有就是说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


    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

你可能感兴趣的:(web前端)