title: Running JSP page in Tomcat Server?
body: <p>I'm new to JSP. I'm  trying to run JSP page in TOMCAT server.</p>
  
  <p>Following are  the steps I used.</p>
  
  <p>1). Created the following JSP page for disaplying current date.</p>
  
  <pre><code>&lt;%@page contentType="text/html" import="java.util.*" %&gt;
  
  &lt;html&gt;
  &lt;body&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;div align="center"&gt;
  &lt;center&gt;
  &lt;table border="0" cellpadding="0" cellspacing
  ="0" width="460" bgcolor="#EEFFCA"&gt;
  
  &lt;tr&gt;
  &lt;td width="100%"&gt;&lt;font size="6" color
  ="#008000"&gt;&amp;nbsp;Date Example&lt;/font&gt;&lt;/td&gt;    
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td width="100%"&gt;&lt;b&gt;&amp;nbsp;Current Date
  and time is:&amp;nbsp; &lt;font color="#FF0000"&gt;    
  &lt;%= new java.util.Date() %&gt;
  &lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/center&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>2) Save it with the name Date.jsp in webapps(webapps/JSPSample/date.jsp) in the tomcat</p>
  
  <p>3) I also created WEB-INF folder inside JSPSample folder.Inside WEB_INF folder I place web.xml with following code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application   2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;
  &lt;web-app&gt;
  &lt;display-name&gt;JSP test client&lt;/display-name&gt;
  &lt;servlet&gt;
  &lt;servlet-name&gt;JSP Sample&lt;/servlet-name&gt;
  &lt;display-name&gt;JSP Sample&lt;/display-name&gt;
  &lt;description&gt;no description&lt;/description&gt;
  &lt;jsp-file&gt;/date.jsp&lt;/jsp-file&gt;
  &lt;/servlet&gt;
  &lt;session-config&gt;
  &lt;session-timeout&gt;30&lt;/session-timeout&gt;
  &lt;/session-config&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>4) The folder structure looks like</p>
  
  <pre><code> webapps
            --JSPSample
                     ----WEB-INF--web.xml
                     ----date.jsp
  </code></pre>
  
  <p>5) Later, opened any internet browser and typed the following URL </p>
  
  <pre><code>   http://localhost:8080/JSPSample/date.jsp
  </code></pre>
  
  <p>Following errors are showing while trying to run the JSP file</p>
  
  <pre><code>    org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      com.hp.sips.basic.container.impl.servlet.RestFilter.doFilter(RestFilter.java:67)
  
  root cause
  
  org.apache.jasper.JasperException: Unable to load class for JSP
      org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:620)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      com.hp.sips.basic.container.impl.servlet.RestFilter.doFilter(RestFilter.java:67)
  
  root cause
  
  java.lang.ClassNotFoundException: org.apache.jsp.UIDesign_jsp
      java.net.URLClassLoader$1.run(Unknown Source)
      java.security.AccessController.doPrivileged(Native Method)
      java.net.URLClassLoader.findClass(Unknown Source)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
      org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      com.hp.sips.basic.container.impl.servlet.RestFilter.doFilter(RestFilter.java:67)
  </code></pre>
  
  <p>When refreshing the page bellow error is also showing</p>
  
  <pre><code>     exception
  
  javax.servlet.ServletException: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      com.hp.sips.basic.container.impl.servlet.RestFilter.doFilter(RestFilter.java:67)
  
  root cause
  
  java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
      org.apache.jasper.compiler.JDTCompiler$2.acceptResult(JDTCompiler.java:370)
      org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:335)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:429)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      com.hp.sips.basic.container.impl.servlet.RestFilter.doFilter(RestFilter.java:67)
  </code></pre>