title: org.apache.jasper.JasperException: Unable to compile class for JSP:
body: <p>Hi I'm trying to compile a simple jsp file with tomcat but I kept having this error message</p>
  
  <pre><code>org.apache.jasper.JasperException: Unable to compile class for JSP: 
  
  An error occurred at line: 13 in the jsp file: /WebContent/test.jsp
  Member cannot be resolved to a type
  10: &lt;body&gt;
  11: &lt;%  
  12:     //MyBatisDao myDao = new MyBatisDao();
  13:     List&lt;Member&gt; list; // = myDao.func("test");
  14:     //out.println("Result list= " + list);
  15: %&gt;
  16: &lt;/body&gt;
  </code></pre>
  
  <p>test.jsp (at Webcontent)</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%&gt;
  &lt;%@ page import="pageNumber.*, java.util.*, java.io.*" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt; 
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;%  
      List&lt;Member&gt; list;
  %&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>Member.java</p>
  
  <pre><code>package pageNumber;
  public class Member {
   private String id;
   private String pw;
   private int point;
   private int lvl;
  
   public Member() {}
   public Member(String id, String pw, int point, int lvl) {
    this.id = id;
    this.pw = pw;
    this.point = point;
    this.lvl = lvl;
   }
  
   public String getId() { return id; }
   public void setId(String id) { this.id = id; }
   public String getPw() { return pw; }
   public void setPw(String pw) { this.pw = pw; }
   public int getPoint() { return point; }
   public void setPoint(int point) { this.point = point; }     
   public int getLvl() { return lvl; }
   public void setLvl(int lvl) { this.lvl = lvl; }
   public String toString() {
    return "ID= " + id + ", PW= " + pw + ", POINT= " + point + ", LVL= " + lvl;
   }
  </code></pre>
  
  <p>}</p>
  
  <p>As far as I can tell, I am having this problem because my tomcat cannot locate the class file, 
  so I have placed my class files at </p>
  
  <ul>
  <li>build/classes/pageNumber (where pageNumber is my package name)</li>
  <li>WEB-INF/classes/pageNumber</li>
  <li>tomcat\work\Catalina\localhost_\org\apache\jsp\pageNumber</li>
  </ul>
  
  <p>but none of it worked out.
  Any help?</p>
  
  <hr>
  
  <p>Edit:
  After I change my import declaration from</p>
  
  <pre><code>&lt;%@ page import="pageNumber.*, java.util.*, java.io.*" %&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;%@ page import="java.util.List, pageNumber.Member" %&gt;
  </code></pre>
  
  <p>It actually gave me a new type of error:</p>
  
  <pre><code>org.apache.jasper.JasperException: Unable to compile class for JSP: 
  
  An error occurred at line: 15 in the generated java file
  Only a type can be imported. pageNumber.Member resolves to a package
  
  An error occurred at line: 12 in the jsp file: /WebContent/test.jsp
  Member cannot be resolved to a type
  9: &lt;/head&gt;
  10: &lt;body&gt;
  11: &lt;%  
  12:     List&lt;Member&gt; list; // = myDao.func("test");
  13: %&gt;
  14: &lt;/body&gt;
  15: &lt;/html&gt; 
  </code></pre>