title: How to call Java classes from JSP
body: <p>I have two JSP files, one for getting the user input and the other for printing the result.
  I have a class file called getdata.java. How should I access that class when the user inputs something and print the result in the result page?</p>
  
  <p>/// getdata.java when user click button it redirect to result page..</p>
  
  <pre><code>&lt;form action="Result.jsp" method="post"&gt;
  &lt;input type="text" name="textname" /&gt;&lt;br&gt;&lt;/br&gt;
  &lt;input type="submit" name="submit" value="Search"/&gt; remove 
  </code></pre>
  
  <p>//// class file</p>
  
  <pre><code>public class On_Classes {
  
      public void  printData()
      {
          ....
      }
  
  }
  </code></pre>
  
  <p>/// result page</p>