Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Eclipse + Tomcat + JSTL

    Ciao a tutti,
    allora, ho scaricato Tomcat e l'ho piazzato in c:\Tomcat
    Ho messo su Eclipse con i WebTools, e ho creato una web-application dinamica, ho fatto una .jsp con dentro una scriptlet tipo questa:

    codice:
    ...
    <% for (int i=1; i < 10; i++) { %>
    <%=i%>
    <% } %>
    ...
    Ho registrato in eclipse il server tomcat e riesco a farlo partire, fermare e debuggare da eclipse (una figata..)

    Ora sto cercando di cambiar la pagina e farla funzionare con le JSTL:

    codice:
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    ...
    <c:forEach var="i" begin="1" end="5" step="1">
    	<c:out value="${i}"></c:out>
    </c:forEach>
    ...
    Ho scaricato da internet i jar di JSTL:
    jstl.jar
    standard.jar

    E li ho ficcati nella dir \common\lib di Tomcat.. e ho riavviato tomcat.

    Il fatto è che la pagina .jsp sopra citata mi dà il seguente errore:

    codice:
    type Exception report
    
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception
    
    org.apache.jasper.JasperException: /index.jsp(8,0) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
    	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
    	org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:952)
    	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:706)
    Avete idee a riguardo?
    Io su un forum avevo trovato che nel web.xml dell'applicazione bisogna dichiarare che verranno usate le JSTL.. il fatto è che ho provato a inserire quei codici XML da metter in web.xml e mi dà errori di validazione sul web.xml :|
    E comunque sempre su quel forum c'era gente che diceva che non vanno messe ste righe nel web.xml

    non so che fare
    A ship is waiting for us at the dock,
    America has trouble to be stopped.
    We must stop terrorism in that land,
    Or freedom will start sliping thru our hands.

  2. #2
    mmm ho scoperto che il problema è nel mio codice..

    cioè se faccio:

    <cut value="hello world" />

    Funziona!
    probabilmente c'è qualche problema nel gestire le espressioni con il dollaro davanti.. avete idee?
    A ship is waiting for us at the dock,
    America has trouble to be stopped.
    We must stop terrorism in that land,
    Or freedom will start sliping thru our hands.

  3. #3
    oh cacchio, ho risolto, era una cavolata, avevo copiato l'URI della taglib da un sito che usava una vecchia versione della JSTL (la 1.0 al posto dlela 1.1...
    A ship is waiting for us at the dock,
    America has trouble to be stopped.
    We must stop terrorism in that land,
    Or freedom will start sliping thru our hands.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.