title: HTTP Status 500 - An exception occurred processing JSP page /index.jsp at line 9
body: <p>I'm trying to run a web app from the packege in Eclipse but i'm still getting those errors whatever i try. I also tried to read and understand error log repport but it doesnt help me since i'm new with all this </p>
  
  <p>Error messge:</p>
  
  <pre><code>type Exception report
  
  message An exception occurred processing JSP page /index.jsp at line 9
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception
  
  org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 9
  
  6: &lt;title&gt;SimpleJspServletDB&lt;/title&gt;
  7: &lt;/head&gt;
  8: &lt;body&gt;
  9: &lt;jsp:forward page="/UserController?action=listUser" /&gt;
  10: &lt;/body&gt;
  11: &lt;/html&gt;
  </code></pre>
  
  <p>It says that there is something wrong on line 9 but it doesnt help me.</p>
  
  <p>Here is my UserController.java class</p>
  
  <pre><code>package com.daniel.controller;
  
  import java.io.IOException;
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  
  import javax.servlet.RequestDispatcher;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import com.daniel.dao.UserDao;
  import com.daniel.model.User;
  
  public class UserController extends HttpServlet {
      private static final long serialVersionUID = 1L;
      private static String INSERT_OR_EDIT = "/user.jsp";
      private static String LIST_USER = "/listUser.jsp";
      private UserDao dao;
  
      public UserController() {
          super();
          dao = new UserDao();
      }
  
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          String forward="";
          String action = request.getParameter("action");
  
          if (action.equalsIgnoreCase("delete")){
              int userId = Integer.parseInt(request.getParameter("userId"));
              dao.deleteUser(userId);
              forward = LIST_USER;
              request.setAttribute("users", dao.getAllUsers());    
          } else if (action.equalsIgnoreCase("edit")){
              forward = INSERT_OR_EDIT;
              int userId = Integer.parseInt(request.getParameter("userId"));
              User user = dao.getUserById(userId);
              request.setAttribute("user", user);
          } else if (action.equalsIgnoreCase("listUser")){
              forward = LIST_USER;
              request.setAttribute("users", dao.getAllUsers());
          } else {
              forward = INSERT_OR_EDIT;
          }
  
          RequestDispatcher view = request.getRequestDispatcher(forward);
          view.forward(request, response);
      }
  
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          User user = new User();
          user.setFirstName(request.getParameter("firstName"));
          user.setLastName(request.getParameter("lastName"));
          try {
              Date dob = new SimpleDateFormat("MM/dd/yyyy").parse(request.getParameter("dob"));
              user.setDob(dob);
          } catch (ParseException e) {
              e.printStackTrace();
          }
          user.setEmail(request.getParameter("email"));
          String userid = request.getParameter("userid");
          if(userid == null || userid.isEmpty())
          {
              dao.addUser(user);
          }
          else
          {
              user.setUserid(Integer.parseInt(userid));
              dao.updateUser(user);
          }
          RequestDispatcher view = request.getRequestDispatcher(LIST_USER);
          request.setAttribute("users", dao.getAllUsers());
          view.forward(request, response);
      }
  }
  </code></pre>
  
  <p>And my DD web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
    &lt;display-name&gt;SimpleJspServletDB&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;servlet&gt;
      &lt;description&gt;&lt;/description&gt;
      &lt;display-name&gt;UserController&lt;/display-name&gt;
      &lt;servlet-name&gt;UserController&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.daniel.controller.UserController&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;UserController&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/UserController&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>And my index.jsp</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=EUC-KR"&gt;
  &lt;title&gt;SimpleJspServletDB&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;jsp:forward page="/UserController?action=listUser" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>