Foro de elhacker.net

Programación => Java => Mensaje iniciado por: Nork en 11 Octubre 2008, 11:27 am



Título: Llamar a una clase con jsp
Publicado por: Nork en 11 Octubre 2008, 11:27 am
Hola, tengo un problema al llamar a una clase desde una página jsp. Aquí esta el código:

Código
  1. <jsp:useBean id="biblioteca" scope="page" class="GestioLlibres"/>
  2. <%
  3. Llibre[] elsllibres = biblioteca.getLlibres(false);
  4. %>
  5. <title>Untitled Document</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. </head>
  8.  
  9. <body bgcolor="#FFFFFF" text="#000000">
  10. <p align="center"><font face="Arial, Helvetica, sans-serif" size="2"><b>LLISTA DE LLIBRES DISPONIBLES A LA BIBLIOTECA</b>
  11. </font></p>
  12. <p>&nbsp;</p>
  13. <% if (elsllibres!=null) for (int n=0; n<elsllibres.length; n++) { %>
  14.  <%=elsllibres[n].getAutor()%>;<b><%=elsllibres[n].getTitol()%></b>
  15. <br>
  16. <% } %>
  17. </body>
  18.  
  19. </html>

Estoy utilizando resign por lo tanto la clase la tengo en WEB-INF/Classes. Pues bien siempre me da el mismo error:

[show] /prueba.jsp:2: cannot find symbol
symbol  : class GestioLlibres
location: class _jsp._prueba__jsp
      GestioLlibres biblioteca;
      ^
/prueba.jsp:2: cannot find symbol
symbol  : class GestioLlibres
location: class _jsp._prueba__jsp
      biblioteca = (GestioLlibres) pageContext.getAttribute("biblioteca");
                    ^
/prueba.jsp:2: cannot find symbol
symbol  : class GestioLlibres
location: class _jsp._prueba__jsp
        biblioteca = new GestioLlibres();
                         ^
/prueba.jsp:4: cannot find symbol
symbol  : class Llibre
location: class _jsp._prueba__jsp
Llibre[] elsllibres = biblioteca.getLlibres(false);
^
4 errors

He buscado bastante por google y nada... lo extraño es que es el código de un curso y (acaso que no haya escrito algo mal) no tiene porque haber fallos en la sintaxis.

S4ludos!


Título: Re: Llamar a una clase con jsp
Publicado por: Nork en 11 Octubre 2008, 17:09 pm
Solucionado, usa tomcat  :xD