title: HTTP Status 500 - Unable to compile class for JSP:
body: <p>Hello Java and JSP gurus please help me sort out this. I have been trying to solve the problem for 2 weeks but have totally failed and it has really stressed me alot. I created three jsp files plus a java bean but have been getting an error message. 
  These are the bin and class path roots.</p>
  
  <p>CLASSPATH: <strong>C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\jsp-api.jar;</strong><br>
  Path: <strong>C:\glassfish3\jdk\bin;</strong>  </p>
  
  <p>First let me provide the jsp files and then the java bean files i have been working on. I'm very new to jsp.</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;BODY&gt;
  &lt;FORM METHOD = POST ACTION = "SaveName.jsp"&gt;
  What's your name ? &lt;INPUT TYPE = TEXT NAME = username SIZE = 20 &gt; &lt;BR&gt;
  What's your e-mail?&lt;INPUT TYPE = TEXT NAME = email SIZE = 20 &gt; &lt;BR&gt;
  What's your age ?  &lt;INPUT TYPE = TEXT NAME = age SIZE = 4 &gt;
  &lt;P&gt; &lt;INPUT TYPE = SUBMIT &gt;
  &lt;/FORM&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>form.jsp</p>
  
  <pre><code>&lt;jsp : useBean id = "user" class="user.UserData" scope="session"/&gt;
  &lt;jsp : setProperty name = "user" property = "*"/&gt;
  &lt;HTML&gt;
  &lt;BODY&gt;
  &lt;A HREF="NextPage.jsp"&gt;Continue&lt;/A&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>SaveName.jsp</p>
  
  <pre><code>&lt;jsp : useBean id = "user" class = "user.UserData" scope = "session"/&gt;
  &lt;HTML&gt;
  &lt;BODY&gt;
  You entered&lt;BR&gt;
  Name: &lt;%= user.getUsername()%&gt; &lt;BR /&gt;
  Email: &lt;%= user.getEmail()%&gt; &lt;BR /&gt;
  Age: &lt;%= user.getAge()%&gt; &lt;BR /&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>NextPage.jsp</p>
  
  <p>I have saved the three files above in the following root path:
   <strong>C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\jsp pages</strong></p>
  
  <pre><code>package user;
  public class UserData 
  {
  
  String username;
  String email;
  int age;
  
  public void setUsername ( String value)
  
  {
  username=value;
  
  }
  
  public void setEmail ( String value)
  
  {
  email=value;
  
  }
  
  public void setAge ( int value)
  {
  age=value;
  
  }
  
  public String getUsername() 
  {
  return username;
  }
  
  public String getEmail()
  {
  return email;
  }
  
  public int getAge()
  {
  return age;
  }
  
  }
  </code></pre>
  
  <p>UserData.java compiled into UserData.class</p>
  
  <p>I have saved the above java bean (.java and .class files) in the root folder below, though I just created the classes folder as it did not exist.
  <strong>C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT\WEB-INF\classes\user</strong></p>
  
  <p>Here is the error code below.</p>
  
  <pre><code>HTTP Status 500 - Unable to compile class for JSP:
  type Exception report
  
  message Unable to compile class for JSP:
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception
  
  org.apache.jasper.JasperException: Unable to compile class for JSP: 
  
  An error occurred at line: 5 in the jsp file: /NextPage.jsp
  user cannot be resolved
  2: &lt;HTML&gt;
  3: &lt;BODY&gt;
  4: You entered&lt;BR&gt;
  5: Name: &lt;%= user.getUsername()%&gt; &lt;BR /&gt;
  6: Email: &lt;%= user.getEmail()%&gt; &lt;BR /&gt;
  7: Age: &lt;%= user.getAge()%&gt; &lt;BR /&gt;
  8: &lt;/BODY&gt;
  
  
  An error occurred at line: 6 in the jsp file: /NextPage.jsp
  user cannot be resolved
  3: &lt;BODY&gt;
  4: You entered&lt;BR&gt;
  5: Name: &lt;%= user.getUsername()%&gt; &lt;BR /&gt;
  6: Email: &lt;%= user.getEmail()%&gt; &lt;BR /&gt;
  7: Age: &lt;%= user.getAge()%&gt; &lt;BR /&gt;
  8: &lt;/BODY&gt;
  9: &lt;/HTML&gt;
  
  An error occurred at line: 7 in the jsp file: /NextPage.jsp
  user cannot be resolved
  4: You entered&lt;BR&gt;
  5: Name: &lt;%= user.getUsername()%&gt; &lt;BR /&gt;
  6: Email: &lt;%= user.getEmail()%&gt; &lt;BR /&gt;
  7: Age: &lt;%= user.getAge()%&gt; &lt;BR /&gt;
  8: &lt;/BODY&gt;
  9: &lt;/HTML&gt;
  
  
   Stacktrace:
  org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
  org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
  org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
  org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
  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:728)
  
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.47 logs.
  Apache Tomcat/7.0.47
  </code></pre>