|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
[JSTL] Accedo al DB, ma spunta questo errore.
Codice:
HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114) org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316) org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211) org.apache.jasper.compiler.ParserController.parse(ParserController.java:100) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:267) org.apache.jasper.compiler.Compiler.compile(Compiler.java:255) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs. -------------------------------------------------------------------------------- Apache Tomcat/5.5.9
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 21-06-2005 alle 17:37. |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Questo è il "file.jsp":
Codice HTML:
<html> <head><title>JDBC with JSTL</title></head> <body> <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <sql:setDataSource driver="org.gjt.mm.mysql.Driver" url="jdbc:mysql://localhost/queryjdbc?user=root&password=MIAPWD" var="conn1" /> <sql:query var="persone" dataSource="${conn1}">select * from persona order by cf /sql:query> <table border=1 align="center"> <thead><th>Codice Fiscale </th><th>Nome </th><th>Cognome </th></thead> <tbody> <c:forEach var="row" items="${persone.rows}"> <tr> <td> <c:out value="${row.cf}"/> </td> <td> <c:out value="${row.name}"/> </td> <td> <c:out value="${row.cognome}"/> </td> </tr> </c:forEach> </tbody> </table> </body> </html>
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 21-06-2005 alle 17:37. |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Che URI dovrei mettere?!
![]() ![]()
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Incredibile
![]() Codice HTML:
<%@ taglib uri="http://java.sun.com/jstl/ea/sql" prefix="sql" %> <%@ taglib uri="http://java.sun.com/jstl/ea/core" prefix="c" %> http://www.onjava.com/pub/a/onjava/2002/03/13/jsp.html ![]() org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/ea/sql cannot be resolved in either web.xml or the jar files deployed with this application
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 21-06-2005 alle 17:37. |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Mar 2004
Messaggi: 1451
|
Hai messo le librerie di jstl e configurato correttamente tomcat per riconoscerle?
__________________
Ciao ~ZeRO sTrEsS~ |
![]() |
![]() |
![]() |
#6 | |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Quote:
1] Ho settato così: D:\www\public_html\WEB-INF\lib\jstl.jar perchè in public_html stanno le mia jsp. 2] Le DBTAG in questa maniera funzionano. 3] il file è da 24kB Mi sembra un problema di URI dei TAG, non della mia configurazione, ma potrei sempre sbagliare.
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. |
|
![]() |
![]() |
![]() |
#7 | |
Senior Member
Iscritto dal: Mar 2004
Messaggi: 1451
|
Quote:
__________________
Ciao ~ZeRO sTrEsS~ |
|
![]() |
![]() |
![]() |
#8 | |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Quote:
E' questo: Codice HTML:
<web-app> <servlet> <servlet-name>GreetingServlet</servlet-name> <servlet-class>GreetingServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>GreetingServlet</servlet-name> <url-pattern>/GreetingServlet</url-pattern> </servlet-mapping> <servlet> <servlet-name>GreetingServletPost</servlet-name> <servlet-class>GreetingServletPost</servlet-class> </servlet> <servlet-mapping> <servlet-name>GreetingServletPost</servlet-name> <url-pattern>/GreetingServletPost</url-pattern> </servlet-mapping> <servlet> <servlet-name>QueryJdbc</servlet-name> <servlet-class>QueryJdbc</servlet-class> </servlet> <servlet-mapping> <servlet-name>QueryJdbc</servlet-name> <url-pattern>/QueryJdbc</url-pattern> </servlet-mapping> </web-app>
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 21-06-2005 alle 17:38. |
|
![]() |
![]() |
![]() |
#9 | |
Senior Member
Iscritto dal: Mar 2004
Messaggi: 1451
|
Quote:
Bisogna mettere una cosa simile nel web.xml (o della tua applicazione o quello generale) <taglib> <taglib-uri>miaJSTL</taglib-uri> <taglib-location>/WEB-INF/c.tld</taglib-location> <taglib>
__________________
Ciao ~ZeRO sTrEsS~ |
|
![]() |
![]() |
![]() |
#10 | |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Quote:
Non le ho mica fatte io che devo specificargliele, se le avessi fatte io ti darei ragione. Infatti per i DBTAG o il JDBC non ho fatto questa dichiarazione, cmq proverò come hai detto tu.
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 10-06-2005 alle 12:57. |
|
![]() |
![]() |
![]() |
#11 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
CMQ quello che dici te forse è un'alternativa all'uso di questa direttiva:
<%@ taglib uri="http://java.sun.com/jstl/ea/sql" prefix="sql" %> dove in teoria mi pare che vada a dirgli dove trovare la definizione in Internet. Forse è meglio provare a definirle come dici tu in locale. Se di questo si tratta.
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. |
![]() |
![]() |
![]() |
#12 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Grillo sono in difficoltà, non è che potresti essere + preciso sulla sintassi che dovrei utilizzare nel web.xml ?!
Codice HTML:
<taglib> <taglib-uri> questo lo ignoro proprio </taglib-uri> <taglib-location>/WEB-INF/lib/jslt.jar</taglib-location> </taglib>
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 24-06-2005 alle 03:15. |
![]() |
![]() |
![]() |
#13 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Ho controllato con le DBTAG cosa facevo e facevo questo nel "file.jsp":
<%@ taglib uri="http://jakarta.apache.org/taglibs/dbtags" prefix="sql" %> e con il file "taglibs-dbtags.jar" in "D:\www\public_html\WEB-INF\lib". Basta, tutto lì.
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 10-06-2005 alle 16:06. |
![]() |
![]() |
![]() |
#14 |
Senior Member
Iscritto dal: Mar 2004
Messaggi: 1451
|
Le direttive da mettere nel web.xml sono :
<taglib> <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/fmt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri> <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/c.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri> <taglib-location>/WEB-INF/c-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/sql.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri> <taglib-location>/WEB-INF/sql-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/x</taglib-uri> <taglib-location>/WEB-INF/x.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri> <taglib-location>/WEB-INF/x-rt.tld</taglib-location> </taglib> Anche se stiamo parlando delle librerie standard, devi comunque dirgli a quale path corrisponde l'uri che gli dai. Ps. Poi quando fai gli include utilizza gli uri che ti ho messo io, visto che sono quelli dell'ultima versione di jstl.
__________________
Ciao ~ZeRO sTrEsS~ |
![]() |
![]() |
![]() |
#15 |
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12103
|
scusa, può essere ke mi confondo, ma tu non eri quello ke kiedeva quali jar utilizzare x le jstl???
poi le hai messe tutte nella directory, non è ke hai saltato il jar in cui ci sono i tag x l'sql???
__________________
![]() |
![]() |
![]() |
![]() |
#16 | |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Quote:
Ma qui non dice che qualcosa è cambiato: June 21, 2004 JSTL 1.2 Specification at java.net The jstl-spec-public project has been launched at java.net. The goal of this project is to make the JSTL 1.2 specification work as transparent as possible to the user community. ... in qualche modo mi rimandano qui: http://java.sun.com/products/jsp/jstl/ magari è qui che troverò la nuova direttiva.
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. |
|
![]() |
![]() |
![]() |
#17 | |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Quote:
Codice HTML:
<taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/lib/jslt.jar</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/lib/jslt.jar</taglib-location> </taglib> ![]() ![]()
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 21-06-2005 alle 17:39. |
|
![]() |
![]() |
![]() |
#18 | |
Senior Member
Iscritto dal: Mar 2004
Messaggi: 1451
|
Quote:
![]()
__________________
Ciao ~ZeRO sTrEsS~ |
|
![]() |
![]() |
![]() |
#19 | |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Quote:
![]() Ho settato così: Codice HTML:
<taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/lib/jstl/javax/servlet/jsp/jstl/core</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/lib/jstl/javax/servlet/jsp/jstl/sql</taglib-location> </taglib>
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 21-06-2005 alle 17:39. |
|
![]() |
![]() |
![]() |
#20 |
Senior Member
Iscritto dal: Jul 2001
Messaggi: 9947
|
Anche secondo Jakarta si fa come dici tu in generale:
http://jakarta.apache.org/taglibs/tutorial.html Installation and Deployment a) Creating a Generic Tag Library To Install a tag library you need to take the following steps: bundle the tag classes in a jar file. Make sure to include the taglib {library}.tld file located in the /WEB-INF directory add the tag {library}.jar file to the CLASSPATH copy the {library}.jar file to the /WEB-INF/lib directory define the taglib element in the /WEB-INF/web.xml file. For example: <taglib> <taglib-uri>http://jakarta.apache.org/taglibs/{library}</taglib-uri> <taglib-location>/WEB-INF/{library}.tld</taglib-location> </taglib> define the tag extension in the jsp page. The <taglib-uri> and the uri directive must match. The prefix identifies the tags in the tag library within the jsp page. For example: <%@ taglib uri="http://jakarta.apache.org/taglibs/{library}" prefix="x" %> Mi segno un po' di link va, che non fa mai male: http://java.sun.com/webservices/docs...TL3.html#72409
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<< Più largo è il sorriso, più affilato è il coltello. Ultima modifica di Matrixbob : 10-06-2005 alle 16:09. |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 09:44.