我错了getting:-
org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet [jsp] threw exception
java.lang.ClassNotFoundException: javax.el.ELResolver
我刚接触过SpringWebMVC和hibernate,我试图用jstl核心标记显示从数据库中获取的记录,但是我遇到了这个错误,我尝试手动添加外部jar,尝试添加jar作为依赖项,我重新安装了tomcat并尝试了不同的版本,我基本上在stackoverflow上尝试了与此问题相关的所有解决方案,我尝试了stackoverflow和其他网站上提到的大约20个解决方案,但都不起作用,请帮助我解决问题。我是在严重的最后期限,我一直试图解决,因为过去几天,但我不能。
我试过的tomcat版本:8.5、9.0.34、9.0.44
我的pom.xmlfile:-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Cyclothon</groupId>
<artifactId>Cyclothon</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
<spring.version>5.2.0.RELEASE</spring.version>
<hibernate.version>5.2.11.Final</hibernate.version>
<hibernate.validator>5.4.1.Final</hibernate.validator>
<c3p0.version>0.9.5.2</c3p0.version>
<jstl.version>1.2.1</jstl.version>
<tld.version>1.1.2</tld.version>
<servlets.version>3.1.0</servlets.version>
<jsp.version>2.3.1</jsp.version>
<hsqldb.version>1.8.0.10</hsqldb.version>
</properties>
<dependencies>
<!-- Spring MVC Dependency -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.0.1.RELEASE</version>
</dependency>
<!-- Spring ORM -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
<!-- Hibernate Core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.5.Final</version>
</dependency>
<!-- JSTL Dependency -->
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>
<version>${jstl.version}</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>${tld.version}</version>
</dependency>
<!-- Servlet Dependency -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlets.version}</version>
<scope>provided</scope>
</dependency>
<!-- JSP Dependency -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>${jsp.version}</version>
<scope>provided</scope>
</dependency>
<!-- HSQL Dependency -->
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>com.razorpay</groupId>
<artifactId>razorpay-java</artifactId>
<version>1.3.7</version>
</dependency>
<dependency>
<groupId>com.instamojo</groupId>
<artifactId>instamojo-java</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
</project>
出现错误的页面:viewpage.jsp:-
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="com.razorpay.RazorpayException"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="css/index_css.css" />
<link rel="stylesheet" href="css/header_css.css" />
<link rel="stylesheet" href="css/footer_css.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<style type="text/css">
h2{
text-align: center;
}
.table{
border-color:#404040;
width:50%;
background-color: rgb(255, 230, 204);
margin-top:20px;
margin-left: 25%;
}
/* Tabled Portrait */
@media screen and (max-height: 950px){
@media screen and (max-width: 800px) {
#primary { width:100%; }
#secondary { width:100%; margin:0; border:none; }
h2{
text-align: center;
}
.table{
border-color:#404040;
width:35%;
font-size:7.5px;
background-color: rgb(255, 230, 204);
margin-top:20px;
margin-left: 15%;
}
}
}
/* Tabled Portrait */
@media screen and (max-height: 750px){
@media screen and (max-width: 550px) {
#primary { width:100%; }
#secondary { width:100%; margin:0; border:none; }
h2{
text-align: center;
}
.table{
border-color:#404040;
width:5%;
font-size:7.5px;
background-color: rgb(255, 230, 204);
margin-top:20px;
margin-left: .5%;
}
}
}
</style>
</head>
<body>
<%@ include file="header.jsp" %>
<div class="context"></div>
<h2>participants Data</h2><br>
<table border="2" class="table">
<th>Name</th>
<th>Contact number</th>
<th>Age</th>
<th>Sex</th>
<th>Address</th>
<th>Email id</th>
<th>Occupation</th>
<th>T-shirt size</th>
<th>Emergency contact name</th>
<th>Emergency contact Number</th>
<th>Blood group</th>
<c:forEach items="${participantList}" var="plist">
<tr>
<td>${plist.id}</td>
<td>${plist.name}</td>
<td>${plist.age}</td>
<td>${plist.sex}</td>
<td>${plist.address}</td>
<td>${plist.email}</td>
<td>${plist.occupation}</td>
<td>${plist.fee}</td>
<td>${plist.nocovid}</td>
<td>${plist.nocontact}</td>
<td>${plist.nohealthissue}</td>
<td>${plist.myresp}</td>
<td>${plist.contactno}</td>
<td>${plist.paymentId}</td>
<td>${plist.transactionId}</td>
</tr>
</c:forEach>
</table>
<%@ include file="footer.jsp" %>
</body>
</html>
非常感谢您的帮助,请帮我解决。我使用的是jdk1.8.0,仅供参考,我的tomcat主目录中有以下jar:el-api.jar、jasper.jar、jasper-el.jar、jsp-api.jar、jaspic-api.jar、servlet-api.jar。
暂无答案!
目前还没有任何答案,快来回答吧!