我想用Jetty預編譯我的JSP文件,所以我不需要用我的Jetty項目發佈編譯器。我使用Ant來實現這一點,但出現錯誤,我不知道如何解決它。Jetty:預編譯使用螞蟻的JSP
taglibs.jsp(4,62)PWC6188:絕對URI: http://java.sun.com/jsp/jstl/core不能在任何web.xml中 或部署該應用程序的jar文件來解決
我使用以下在另一StackOverflow的問題中提到的Ant腳本: precompile jsps into classes for Jetty8 using ant
<property name="jetty.home" value="C:/jetty-distribution-8.1.8.v20121106" />
<path id="compile.jspc">
<fileset dir="${jetty.home}">
<include name="lib/servlet-api-*.jar" />
<include name="lib/jsp/*.jar" />
</fileset>
</path>
<target name="jspc" depends="compile">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" classpathref="compile.jspc" />
<jasper2 validateXml="false"
uriroot="WebContent"
addWebXmlMappings="true"
webXmlFragment="WebContent/WEB-INF/generated_web.xml"
compilerSourceVM="1.6"
compilerTargetVM="1.6"
outputDir="build/gen-src"
verbose="9" />
</target>
什麼可能出問題,並觸發這個錯誤?仔細檢查classpath並加載所有necassary .jar文件。與其他論壇帖子中提到的JSTL版本無關。
最好的問候, user2255297
UPDATE:Taglibs.jsp的內容
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="stripesDynamic" uri="http://stripes.sourceforge.net/stripes-dynattr.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%-- Short hand for the context root. --%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
更改了類路徑,以便它只引用WebContent/WEB-INF/lib文件夾中的.jar文件。我檢查了我正在使用的版本,並且它們與您的列表匹配。它還能是什麼? generated_web.xml文件生成後不包含語法限制 – user2255297 2013-04-10 10:05:40
下載了您附加到答案的示例[link](http://stackoverflow.com/questions/11735628/precompile-jsps-into-classes-for -jetty8-using-ant)該示例運行正常,但是當我將taglibs.jsp文件複製到示例項目中時,會出現相同的錯誤。我已將Standard和JSTL jar包含在lib文件夾中。 – user2255297 2013-04-10 11:39:28
將您的taglibs.jsp複製/粘貼到問題上。 – 2013-04-10 13:17:44