title: Importing java classes into JSP
body: <p>That's the problem.</p>
  
  <p>I developed a web app with <code>NetBeans 7</code>, <code>Tomcat 7</code> and <code>hsqldb</code>; on my desktop all is Ok.</p>
  
  <p>When I upload my java files (.class, .jsp and .jar packages) to my site and try to load a jsp page which imports a class contained in a package (class <code>FunzioniSessione</code> in package <code>it.swlab.util</code>), I get the following error:</p>
  
  <pre><code>org.apache.jasper.JasperException: Unable to compile class for JSP:  
  An error occurred at line: 6 in the generated java file 
  Only a type can be imported. it.swlab.util.FunzioniSessione resolves to a package 
  
  An error occurred at line: 7 in the jsp file: /index.jsp 
  FunzioniSessione cannot be resolved to a type 
  4: &lt;% 
  5: synchronized(this) 
  6: { 
  7: FunzioniSessione funzioniSessione = new FunzioniSessione(); 
  8: String percorso = config.getServletContext().getRealPath("/"); 
  9: funzioniSessione.inizializza(session,request,response,percorso,"infocar"); 
  10: boolean connesso = session.getAttribute("utenteConnesso") != null; 
  
  An error occurred at line: 7 in the jsp file: /index.jsp 
  FunzioniSessione cannot be resolved to a type 
  4: &lt;% 
  5: synchronized(this) 
  6: { 
  7: FunzioniSessione funzioniSessione = new FunzioniSessione(); 
  8: String percorso = config.getServletContext().getRealPath("/"); 
  9: funzioniSessione.inizializza(session,request,response,percorso,"infocar"); 
  10: boolean connesso = session.getAttribute("utenteConnesso") != null; 
  
  Stacktrace: 
   org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) 
   org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) 
   org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451) 
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:328) 
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:307) 
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) 
   org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) 
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) 
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) 
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) 
   javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 
  
  note The full stack trace of the root cause is available in the Apache Tomcat/5.5.33 logs. 
  </code></pre>
  
  <p>To prevent some obvious answers, I add some more information:</p>
  
  <ol>
  <li>The package containing the class FunzioniSessione (named <code>funzioniComuni.jar</code>) is in the <code>WEB-INF\lib</code> folder</li>
  <li>I can't look at the logs as the note in the stacktrace suggests, because I have no access to the logs folder of my provider's Tomcat server.
  3 The directive for the import is <code>&lt;%@page import="it.swlab.util.FunzioniSessione"%&gt;</code> I tried also with a ";" at the end (<code>&lt;%@page import="it.swlab.util.FunzioniSessione;"%&gt;</code>) but with no success.</li>
  </ol>
  
  <p>I wait for some suggestions.</p>
  
  <p>Thank you </p>