Newsgroup: it.comp.java
Titolo: problema con JSP

Premetto che sono alle prime armi.
Sto provando gli esempi che ci sono sul libro JavaServer Pages di
Tecniche nuove. Ecco il mio problema.
In questo esempio di creazione di un vector Apache Tomcat 4 si
arrabbia.
Qual'č la soluzione?
Ecco l'esempio:
<HTML>
<HEAD><TITLE>Esempio di uso di enumerazioni</TITLE></HEAD>
<BODY>
<%!  String name         = new String("Jonh Doe");
     Integer ssn         = new Integer(111223333);
     Double salary       = new Double(65432.10);
     Vector employee     = new Vector();
     String[] infoTitles = {"Name", "SSN", "Salary"};
%>
<%   employee.addElement(name);
     employee.addElement(ssn);
     employee.addElement(salary);
     int i = 0;
     Enumeration employeeInfo = employee.elements();
     while(employeeInfo.hasMoreElements()){ %>
       <P> Employee <%= infoTitles[i++] %>:
          <%= (Object)employeeInfo.nextElement() %>
<%   } %>
</BODY>
</HTML>
Ecco l'errore:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occured between lines: 4 and 9 in the jsp file:
/jsp/mieJSP/Ora7/usingEnumerations.jsp
Generated servlet error:
C:\Programmi\Apache Tomcat
4.0\work\localhost\examples\jsp\mieJSP\Ora7\usingEnumerations$jsp.java:15:
Class org.apache.jsp.Vector not found.
             Vector employee     = new Vector();
                                 ^
An error occured between lines: 4 and 9 in the jsp file:
/jsp/mieJSP/Ora7/usingEnumerations.jsp
Generated servlet error:
C:\Programmi\Apache Tomcat
4.0\work\localhost\examples\jsp\mieJSP\Ora7\usingEnumerations$jsp.java:15:
Class org.apache.jsp.Vector not found.
             Vector employee     = new Vector();
                                       ^
An error occured between lines: 10 and 15 in the jsp file:
/jsp/mieJSP/Ora7/usingEnumerations.jsp
Generated servlet error:
C:\Programmi\Apache Tomcat
4.0\work\localhost\examples\jsp\mieJSP\Ora7\usingEnumerations$jsp.java:69:
Class org.apache.jsp.Vector not found in void
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse).
                   employee.addElement(name);
                                      ^
An error occured between lines: 10 and 15 in the jsp file:
/jsp/mieJSP/Ora7/usingEnumerations.jsp
Generated servlet error:
C:\Programmi\Apache Tomcat
4.0\work\localhost\examples\jsp\mieJSP\Ora7\usingEnumerations$jsp.java:70:
Class org.apache.jsp.Vector not found in void
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse).
                     employee.addElement(ssn);
                                        ^
An error occured between lines: 10 and 15 in the jsp file:
/jsp/mieJSP/Ora7/usingEnumerations.jsp
Generated servlet error:
C:\Programmi\Apache Tomcat
4.0\work\localhost\examples\jsp\mieJSP\Ora7\usingEnumerations$jsp.java:71:
Class org.apache.jsp.Vector not found in void
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse).
                     employee.addElement(salary);
                                        ^
An error occured between lines: 10 and 15 in the jsp file:
/jsp/mieJSP/Ora7/usingEnumerations.jsp
Generated servlet error:
C:\Programmi\Apache Tomcat
4.0\work\localhost\examples\jsp\mieJSP\Ora7\usingEnumerations$jsp.java:73:
Class org.apache.jsp.Enumeration not found.
                     Enumeration employeeInfo = employee.elements();
                     ^
An error occured between lines: 10 and 15 in the jsp file:
/jsp/mieJSP/Ora7/usingEnumerations.jsp
Generated servlet error:
C:\Programmi\Apache Tomcat
4.0\work\localhost\examples\jsp\mieJSP\Ora7\usingEnumerations$jsp.java:73:
Class org.apache.jsp.Vector not found in void
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse).
                     Enumeration employeeInfo = employee.elements();
                                                                 ^
7 errors
	at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
	at
org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
	at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
	at java.lang.Thread.run(Thread.java:484)


devi usare la direttiva @page con import = java.util.Vector in 
particolare :
<%@page contentType="text/html" import="java.util.Vector"%>
Questo perche` Tomcat 4 non riesce a trovare direttamente le classi 
del JDK come faceva tomcat 3.3
anche io ho avuto questo problema
-- 
Ciao
Rotondi Marco
E-mail:ef...@interfree.it
E-mail:mr53...@silab.dsi.unimi.it
E-mail:marco...@tiscalinet.it
WEB PAGE: 
http://ef164.interfree.it
== Team OS/2 it ==

> Qual'č la soluzione?
