title: Why do i get the following error while running a java web application?
body: <p>I am following this tutorial 
  <a href="http://netbeans.org/kb/docs/web/quickstart-webapps.html" rel="nofollow">http://netbeans.org/kb/docs/web/quickstart-webapps.html</a></p>
  
  <p>and as mentioned i have created two jsp pages.My index.jsp page looks like this</p>
  
  <pre><code>%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
          Name&lt;form name="Name Input Form" action="response.jsp"&gt;
              &lt;input type="text" name="name" value="" /&gt;
              &lt;input type="submit" value="OK" /&gt;
          &lt;/form&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and my response.jsp looks like this</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;jsp:useBean id="useBean" scope="session" class="abc.NameHandler" /&gt;
  
          &lt;jsp:setProperty name="myBean" property="name" /&gt;&lt;h1&gt;Hello&lt;/h1&gt;
          &lt;jsp:getProperty name="myBean" property="name" /&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and i have created a package named abc where i ave defined a class named NameHandler.</p>
  
  <pre><code>package abc;
  
  public class NameHandler 
  {
  
      private String name;
  
      public NameHandler() 
      {
          name =null;
  
      }
  
      /**
       * @return the name
       */
      public String getName() {
          return name;
      }
  
      /**
       * @param name the name to set
       */
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>when i run the project index.jsp is displayed correctly and it commands to enter a name and it has a submit button.Now when i press the submit button i get the following error.</p>
  
  <pre><code>HTTP Status 500 -
  
  type Exception report
  
  message
  
  descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
  
  exception
  
  org.apache.jasper.JasperException: java.lang.NullPointerException
  
  root cause
  
  java.lang.NullPointerException
  
  note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1 logs.
  GlassFish Server Open Source Edition 3.1
  </code></pre>
  
  <p>ANd i have no idea why i get this error.Could anyone please explain?</p>
  
  <p><strong>[UPDATE]</strong></p>
  
  <p>What does this error means?</p>
  
  <pre><code>WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
  java.lang.NullPointerException
      at org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:368)
      at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:354)
      at org.apache.jsp.response_jsp._jspService(response_jsp.java from :68)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:619)
  </code></pre>