title: error in importing java class in jsp file
body: <p>I am trying to import my java class into the jsp</p>
  
  <p>my java filename is <code>test2.java</code>
  my jsp filename is <code>test1.jsp</code></p>
  
  <p>both the files are in the same folder i.e <code>/var/lib/tomcat7/webapps/ROOT/</code></p>
  
  <p>this is my code :</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;Hello World&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  Hello World!&lt;br/&gt;   
  &lt;%@ page import="test2" %&gt;
  
  &lt;%
  out.println("Your IP address is " + request.getRemoteAddr());
  %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It gives error when I run in apache tomcat server.Here is the error:<br></p>
  
  <pre><code>type Exception report
  
  message java.lang.ClassNotFoundException: org.apache.jsp.test1_jsp
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception
  
  org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.test1_jsp
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
  </code></pre>