问题描述
我用想法2016创建一个jsp项目,jsf的代码如下.
I create a jsp project with idea 2016 and the code of jsf is as following.
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<title>JSP 2.0 Expression Language - Implicit Objects</title>
</head>
<body>
<h1>JSP 2.0 Expression Language - Implicit Objects</h1>
<hr>
This example illustrates some of the implicit objects available
in the Expression Language. The following implicit objects are
available (not all illustrated here):
<ul>
<li>pageContext - the PageContext object</li>
<li>pageScope - a Map that maps page-scoped attribute names to
their values</li>
<li>requestScope - a Map that maps request-scoped attribute names
to their values</li>
<li>sessionScope - a Map that maps session-scoped attribute names
to their values</li>
<li>applicationScope - a Map that maps application-scoped attribute
names to their values</li>
<li>param - a Map that maps parameter names to a single String
parameter value</li>
<li>paramValues - a Map that maps parameter names to a String[] of
all values for that parameter</li>
<li>header - a Map that maps header names to a single String
header value</li>
<li>headerValues - a Map that maps header names to a String[] of
all values for that header</li>
<li>initParam - a Map that maps context initialization parameter
names to their String parameter value</li>
<li>cookie - a Map that maps cookie names to a single Cookie object.</li>
</ul>
</body>
</html>
我收到了以下错误信息.
I got following error info.
HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
type Exception report
message java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:376)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:372)
java.net.URLClassLoader$1.run(URLClassLoader.java:361)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:360)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:376)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.69 logs.
Apache Tomcat/7.0.69
我删除下面的行后,异常消失了.
After I remove below line, the exception disappears.
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
我下载了jstl-1.2.jar并将其添加到项目的外部库中.问题仍然存在.有人知道如何处理或调试问题吗?
I downloaded jstl-1.2.jar and added it into external libraries of my project. The issue is still there. Anybody knows how to handle or debug the issue?
推荐答案
最后,我自己解决了此问题.步骤如下:
Finally I resolved the issue by myself. Below are steps:
1.从下面的链接下载jstl-1.2.jar和standard-1.1.2.jar.
1.Download jstl-1.2.jar and standard-1.1.2.jar from below links.
http://repo2.maven.org/maven2/javax/servlet/jstl /
http://repo2.maven.org/maven2/taglibs/standard/
2.将两个文件复制到Tomcat lib文件夹中.
2.Copy the two files into Tomcat lib folder.
3.将standard-1.1.2.jar重命名为standard.jar.
3.Rename standard-1.1.2.jar to standard.jar.
然后异常消失.
这篇关于HTTP状态500-java.lang.ClassNotFoundException:由于taglib而导致的org.apache.jsp.index_jsp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!