java - org.apache.jasper.JasperException : The absolute uri: http://java. sun.com/jsp/jSTL/core 无法解析

标签 java jsp jstl

<分区>

org.apache.jasper.JasperException: 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

当我运行我的应用程序时,出现此错误。

这是我的 userForm.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
.even {
    background-color: silver;
}
</style>
<title>Registration Page</title>
</head>
<body>

<form:form action="add.htm" commandName="user">
    <table>
        <tr>
            <td>User Name :</td>
            <td><form:input path="name" /></td>
        </tr>
        <tr>
            <td>Password :</td>
            <td><form:password path="password" /></td>
        </tr>
        <tr>
            <td>Gender :</td>
            <td><form:radiobutton path="gender" value="M" label="M" /> <form:radiobutton
                path="gender" value="F" label="F" /></td>
        </tr>
        <tr>
            <td>Country :</td>
            <td><form:select path="country">
                <form:option value="0" label="Select" />
                <form:option value="India" label="India" />
                <form:option value="USA" label="USA" />
                <form:option value="UK" label="UK" />
            </form:select></td>
        </tr>
        <tr>
            <td>About you :</td>
            <td><form:textarea path="aboutYou" /></td>
        </tr>
        <tr>
            <td>Community :</td>
            <td><form:checkbox path="community" value="Spring"
                label="Spring" /> <form:checkbox path="community" value="Hibernate"
                label="Hibernate" /> <form:checkbox path="community" value="Struts"
                label="Struts" /></td>
        </tr>
        <tr>
            <td></td>
            <td><form:checkbox path="mailingList"
                label="Would you like to join our mailinglist?" /></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="Register"></td>
        </tr>
    </table>
</form:form>
<c:if test="${fn:length(userList) > 0}">
    <table cellpadding="5">
        <tr class="even">
            <th>Name</th>
            <th>Gender</th>
            <th>Country</th>
            <th>About You</th>
        </tr>
        <c:forEach items="${userList}" var="user" varStatus="status">
            <tr class="<c:if test="${status.count % 2 == 0}">even</c:if>">
                <td>${user.name}</td>
                <td>${user.gender}</td>
                <td>${user.country}</td>
                <td>${user.aboutYou}</td>
            </tr>
        </c:forEach>
    </table>
</c:if>
</body>
</html>

下面是web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns="http://java.sun.com/xml/ns/javaee" 
         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
         id="WebApp_ID" version="2.5">
  <display-name>SpringExample17</display-name>
  <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>redirect.jsp</welcome-file>
    </welcome-file-list>
</web-app>

最佳答案

这意味着没有安装 JSTL。只需放下 jstl-1.2.jar/WEB-INF/lib 文件夹中并重新启动服务器。

关于java - org.apache.jasper.JasperException : The absolute uri: http://java. sun.com/jsp/jSTL/core 无法解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4501472/

相关文章:

java - 阻止java桌面应用程序的分发

java - 如何在同一测试中使用 2 个不同的参数捕获器类

java - 谷歌地图使用java和jsp在Web应用程序中绘制源和目的地之间的路线

javascript - 当在 jsp 中点击一个按钮时,它再次调用 js 中的 ready 函数。错误

java - JSTL 测试和 HTML 输入

java - 如何根据用户输入更新 bean

java - 我需要将 PDDocument 转换为文件对象

java - Firebase SetValue() 和 SetValueAsync() 方法之间有什么区别以及何时使用它们?

jsp - 从 JSP 输出创建 PDF

java - 使用 Struts2 taglib 通过 URL 将参数传递给操作