Maven项目启动报错:The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml

来源:互联网 发布:u盘恢复数据多少钱 编辑:程序博客网 时间:2024/05/19 20:59

一、问题描述


Eclipse创建Maven项目修改web.xml版本号为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">    <display-name>Elasticserach</display-name></web-app>

然后在POM.XML中加入JSTL1.2


    <!-- JSTL --><dependency>      <groupId>javax.servlet</groupId>      <artifactId>jstl</artifactId>      <version>1.2</version>  </dependency>  


在index.jsp页面加入c标签


<%@ page language="java" contentType="text/html; charset=utf-8"pageEncoding="utf-8"%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

一运行项目就提示错误如下: 

HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application




二、解决方法


解决方法就是复制jstl到tomcat/lib目录下就行了!!!



阅读全文
0 0
原创粉丝点击