Salve a tutti ragazzi,
sto facendo un piccolo progetto per l'università, e sto usando jsp con netbeans 6.8 e server glassfish v3 che si appoggia su un database mysql su una macchina windows 7.

Ho strutturato il DB con due tabelle utente e prodotto con relazione uno a n.
Ho provato a seguire questo tutorial adattandolo alle mie esigenze, mi sono bloccato al punto 10 della sessione Adding data with EJBs, seguendo il tutorial ho creato le mie entità dal DB e le javaBeans sempre dal DB e il mio file index.jsp è fatto cosi:
codice:
           
<%--
<sql:query var="utenti" dataSource="jdbc/whishlistDB">
    SELECT ut_id,ut_nome FROM utente
</sql:query>
--%>

<div id="indexcs">                 
  <div id="benvenuto">                     
    <h3> benvenuto nella whishlist </h3>                      
       utentiImagePath: ${initParam.utentiImagePath}                     
       prodottiImagePath: ${initParam.prodottiImagePath}                  
  </div>             
</div>              
<div id="indexcd">                                  
    <c:forEach var="u" items='${utenti}'>                
        <div class="utentiBox">                        
           <a href="utenti?${utente.ut_id}">                                                     
     <spanclass="utentiLabelText">${utente.ut_nome</span>                                             
[img]${initParam.utentiImagePath}${utente.ut_nome}.jpg[/img]                                                         
</a>                       
</div>                 
</c:forEach>            
 </div>
Ho questo problema togliendo la query dalla pagina perche settata nel file controllerServlet che postato sotto non mi visualizza errori ma non mi visualizza il div dentro il foreach non entra proprio nel ciclo , lo stesso codice passato dal mio pc su quello di una mia amica funziona, mi sapete spiegare il motivo??? o dove sbaglio???? Grazie mille a tutti!!!

File ControllerServlet.java
codice:
package controller;

import javax.ejb.EJB;
import session.UtenteFacade;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;


/**
 *
 * @author Silverio
 */
public class ControllerServlet extends HttpServlet {

    private String userPath;

    @EJB
    private UtenteFacade utenteFacade;

    @Override
    public void init() throws ServletException {
        getServletContext().setAttribute("utenti", utenteFacade.findAll()); //questa dovrebbe essere la parte fondamentale cioè quella che dovrebbe farmi entrare nel ForEach e invece non funzia....
    }
    /**
     * Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {

        //HttpSession session = request.getSession(true);
        userPath = request.getServletPath();

        // if category page is requested
        if (userPath.equals("/utenti")) {
            // TODO: Implement request utenti

        // if shopping cart page is requested
        } else if (userPath.equals("/vediCarrello")) {
            userPath = "/carrello";
            // TODO: Implement request carrello

        // if checkout page is requested
        } else if (userPath.equals("/checkout")) {
            // TODO: Implement checkout page request

        // if user switches language
        } else if (userPath.equals("/scegliLingua")) {
            // TODO: Implement language request

        }

        // use RequestDispatcher to forward request internally
        String url = "/WEB-INF/view" + userPath + ".jsp";
        try {
            request.getRequestDispatcher(url).forward(request, response);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    /**
     * Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {

        userPath = request.getServletPath();

        // if addToCart action is called
        if (userPath.equals("/addCarrello")) {
            // TODO: Implement add product to cart action

        // if updateCart action is called
        } else if (userPath.equals("/upCarrello")) {
            // TODO: Implement update cart action

        // if purchase action is called
        } else if (userPath.equals("/acquista")) {
            // TODO: Implement purchase action

        }

        // use RequestDispatcher to forward request internally
        String url = "/WEB-INF/view" + userPath + ".jsp";

        try {
            request.getRequestDispatcher(url).forward(request, response);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    /**
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "The ControllerServlet handles incoming requests by initiating any" +
                " actions performed by the database access object (DAO), then forwarding" +
                " the request to the appropriate view.";
    }

}
Posto anche il file web.xml

codice:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
        <description>path immagini utenti</description>
        <param-name>utentiImagePath</param-name>
        <param-value>img/categories/</param-value>
    </context-param>
    <context-param>
        <description>path immagini prodotti</description>
        <param-name>prodottiImagePath</param-name>
        <param-value>img/products/</param-value>
    </context-param>
    
    <servlet>
        <servlet-name>ControllerServlet</servlet-name>
        <servlet-class>controller.ControllerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ControllerServlet</servlet-name>
        <url-pattern>/vediCarrello</url-pattern>
        <url-pattern>/addCarrello</url-pattern>
        <url-pattern>/utenti</url-pattern>
        <url-pattern>/upCarrello</url-pattern>
        <url-pattern>/acquista</url-pattern>
        <url-pattern>/scegliLingua</url-pattern>
        <url-pattern>/checkout</url-pattern>
    </servlet-mapping> 
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <jsp-config>
        <jsp-property-group>
            <description>header footer set</description>
            <url-pattern>/index.jsp</url-pattern>
            <url-pattern>/WEB-INF/view/*</url-pattern>
            <include-prelude>/WEB-INF/jspf/header.jspf</include-prelude>
            <include-coda>/WEB-INF/jspf/footer.jspf</include-coda>
        </jsp-property-group>
    </jsp-config>
</web-app>
Mi scuso con tutti per la lunghezza del post...solo che ho bisogno di aiuto, non so come risolvere, ciaooo grazie ancora a tutti!!!