title: Importing java class to jsp causing cannot be resolved to a type error
body: <p>JSP code:</p>
  
  <pre><code>    &lt;%@ page import = "action.LoginCheckAction" %&gt;
  &lt;%
  String username = request.getParameter("username");
  String password = request.getParameter("password");
  
      LoginCheckAction ls = new LoginCheckAction();
      ls.printSomething(username);
  %&gt;
  </code></pre>
  
  <p>Java class:</p>
  
  <pre><code>    package action;
  
  public class LoginCheckAction{
      public LoginCheckAction(){
          super();
      }
  
      public void printSomething(String username){
          System.out.println(username);
      }
  }
  </code></pre>
  
  <p>Another JSP file is sending post data to the JSP code posted here. 
  I am trying to use the method available in my Java file that is located in another directory, inside the package action, however it keeps giving me a <code>LoginCheckAction cannot be resolved to a type</code>.</p>
  
  <p>I tried importing <code>action.*</code> instead, and it did not work.</p>
  
  <p>Can anyone please explain what the problem is?</p>