PDA

Visualizza la versione completa : [JAVA] Problemi con JSTL (e con x:foreach?)


6sic6
21-10-2005, 14:29
sto cercando di fare una semplice pag per la gestione dei rss
la pagina rss.jsp cosi definita

<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="ciccio" %>
<%@ taglib prefix="x" uri="xciccio"%>
<c:set var="cachePeriod" value="${60 * 60}" />
<jsp:useBean id="now" class="java.util.Date" />
<c:if test="${(now.time - cacheTime) > cachePeriod}">
<c:import
url="http://www.html.it/rss/webnews_news.xml"varReader="xmlSource">
<x:parse var="doc" xml="${xmlSource}" scope="application" />
</c:import>
<c:set var="cacheTime" value="${now.time}" scope="application" />
</c:if>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Feed RSS</title>
</head>
<body>
<table width="200" border="0">
<x:forEach select="$doc/rss/channel/item">
<tr>
<td ><a href="<x:out select="link" />">
<x:out select="title" /></a></td>
</tr>
<tr>
<td><x:out select="description" /></td>
</tr>
</x:forEach>
</table>
</body>
</html>

dove le uri ciccio e xciccio puntano rispettivamente a c.tld e x.tld in
WEB-INF, il war.xml configurato correttamente i jar standard e jstl
stanno in WEB-INF/lib

il problema che tomcat mi restituisce l'errore

exception

javax.servlet.ServletException: org/apache/xpath/XPathException
org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:779)
org.apache.jsp.index_jsp._jspService(index_jsp.jav a:114)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:362)

root cause

java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java :620)
java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:1626)
org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:850)
org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1299)
org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1181)
java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
org.apache.taglibs.standard.tag.common.xml.ForEach Tag.prepare(ForEachTag.java:49)
javax.servlet.jsp.jstl.core.LoopTagSupport.doStart Tag(LoopTagSupport.java:227)
org.apache.jsp.index_jsp._jspx_meth_x_forEach_0(in dex_jsp.java:265)
org.apache.jsp.index_jsp._jspService(index_jsp.jav a:103)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:362)

e nn so a che sia dovuto
qualche consiglio?
thx ;)

6sic6
22-10-2005, 22:15
help!? :confused:

6sic6
24-10-2005, 20:04
qyualcuno m puo aiutare??

6sic6
29-10-2005, 14:56
oo

Loading