我目前正在学习spring mvc并做了一个例子"我的应用程序"其中包括spring mvc和apache tiles。一切正常,但在jsp我得到以下错误:
无法找到" http://www.springframework.org/tags/form"
的标记库描述符这是我的mainLayout.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><tiles:getAsString name="title" /></title>
<link href="<c:url value='/static/css/bootstrap.css' />" rel="stylesheet"></link>
<link href="<c:url value='/static/css/app.css' />" rel="stylesheet"></link>
</head>
<body>
<header id="header">
<tiles:insertAttribute name="header" />
</header>
<section id="site-content">
<tiles:insertAttribute name="body" />
</section>
<footer id="footer">
<tiles:insertAttribute name="footer" />
</footer>
</body>
</html>
在你问之前,我已将所有弹簧,瓷砖和jstl依赖包含在我的pom中。 只有表格标签才会出错。
答案 0 :(得分:0)
似乎您的标记库在类路径中缺失 因为您不必配置任何东西。由于可以自动发现JSP 2.0 taglib。
您需要做的就是将它们放在WEB-INF或它的子文件夹中。如果您将TLD打包为JAR文件,请将它们放在JAR的WEB-INF / lib或META-INF中