title: Can't use <jsp:useBean>: "Bean cannot be resolved to a type"
body: <p>I'm just playing around with JSP. I just wanted to test some <code>&lt;jsp:useBean&gt;</code> stuff, but I can't. Every time if I'm using <code>&lt;jsp:useBean&gt;</code>, I get an error. Even if I just have this, I get an error:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
      pageEncoding="UTF-8"%&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;Test&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;jsp:useBean id="mybean" class="Users" scope="session" &gt;
        &lt;jsp:setProperty name="mybean" property="name" value="Hello world" /&gt;
      &lt;/jsp:useBean&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Without the <code>&lt;jsp:useBean&gt;</code> it runs fine. With the <code>&lt;jsp:useBean&gt;</code> I get an error like:</p>
  
  <pre><code>Servlet.service() for servlet [jsp] in context with path [/JSPTest] threw exception [Unable to compile class for JSP: 
  
  An error occurred at line: 10 in the jsp file: /index.jsp
  Users cannot be resolved to a type
  7:     &lt;title&gt;Insert title here&lt;/title&gt;
  8:   &lt;/head&gt;
  9:   &lt;body&gt;
  10:     &lt;jsp:useBean id="mybean" class="Users" scope="session" &gt;
  11:       &lt;jsp:setProperty name="mybean" property="name" value="Hello world" /&gt;
  12:     &lt;/jsp:useBean&gt;
  13:   &lt;/body&gt;
  </code></pre>
  
  <p>I am using Eclipse, Tomcat 7.0.23 and Java 1.7.0_01.</p>
  
  <p>Any ideas?</p>
  
  <p>PS: I had to change the port 8xxx to 9xxx because the oracle DB is using the standard 8xxx. But that's likely not the cause of the problem.</p>