title: org.apache.jasper.JasperException: An exception occurred processing JSP page /editinfo.jsp
body: <p>I have this jsp code where I am trying to edit information for the user my web page. I am new to jsp programming and I'm experiencing errors. Here is my code:</p>
  
  <pre><code>&lt;%@page import="DatabaseTransactions.UserPhotosDataContext"%&gt;
  &lt;%@page import="java.sql.ResultSet"%&gt;
  &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;%
              if (session.getAttribute("id") == null) {
                  response.sendRedirect(request.getContextPath() + "/sign-in.jsp");
              }
  
              int userId = Integer.parseInt(session.getAttribute("id").toString());
              ResultSet userInfo = UserPhotosDataContext.getUserProfileInfo(userId);
  %&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;Edit Information&lt;/title&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
  
          &lt;!-- Bootstrap --&gt;
          &lt;link href="css/bootstrap.min.css" rel="stylesheet" media="screen"&gt;
          &lt;link href="styles.css" rel="stylesheet"&gt;
      &lt;/head&gt;
  
      &lt;body class="bodybg"&gt;
          &lt;jsp:include page="/navigation.jsp"/&gt;
          &lt;% userInfo.next();%&gt;
  
          &lt;div class="boxouter" style="margin-top:50px;"&gt;
              &lt;h3 class="muted"&gt;Edit Information&lt;/h3&gt;
              &lt;!--- more code here----&gt;
  
                  &lt;br&gt;&lt;br&gt;
                  &lt;form id="update-form" method="" action=""&gt;
                      &lt;table style="margin:auto"&gt;
                          &lt;tr&gt;
                              &lt;!--username--&gt;
                              &lt;td&gt;
                                  &lt;label&gt;Username &lt;span id="uname-error" class="form-error"&gt;&lt;/span&gt;&lt;/label&gt;
                                  &lt;input type="text" title="Use at least 6 characters"
                                         name="username" id="uname"
                                         value="&lt;%=userInfo.getString("username")%&gt;"
                                         placeholder="Username" disabled="true"&gt;
                              &lt;/td&gt;
  
                              &lt;!--email--&gt;
                              &lt;td&gt;
                                  &lt;label&gt;Email &lt;span id="email-error" class="form-error"&gt;&lt;/span&gt;&lt;/label&gt;
                                  &lt;input type="text"
                                         name="email" id="email"
                                         value="&lt;%=userInfo.getString("email")%&gt;"
                                         placeholder="Email" disabled="true"&gt;
                              &lt;/td&gt;
                          &lt;/tr&gt;
  
                          &lt;!--- more code here----&gt;
  
                      &lt;/table&gt;
  
                      &lt;center/&gt;
                      &lt;button class="btn btn-info" onclick="enablefields();" id="enablebtn" style="visibility:visible"&gt;Edit Information&lt;/button&gt;
  
                      &lt;a id="savelink" href="#" style="color:white;"&gt;
                          &lt;button class="btn btn-info" id="savebtn" type="submit" style="visibility:hidden"&gt;Save&lt;/button&gt;
                      &lt;/a&gt;
  
                      &lt;a href="#" style="color:white"&gt;
                          &lt;button class="btn btn-info" id="deactivatebtn" style="visibility:visible"&gt;Deactivate Account&lt;/button&gt;
                      &lt;/a&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
  
          &lt;br&gt;&lt;br&gt;
  
          &lt;!--- more code here----&gt;
  
      &lt;script type="text/javascript"&gt;
          function setValues() {
              if ("&lt;%=userInfo.getString("gender")%&gt;" == "Male")
              $('select option:contains("Male")').prop('selected',true);
  
              else if ("&lt;%=userInfo.getString("gender")%&gt;" == "Female")
              $('select option:contains("Female")').prop('selected',true);
          }
  
          window.onload = setValues;
  
      &lt;/script&gt;
  
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/jquery.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/bootstrap.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/bootstrap-modal.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/bootstrap-popover.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/bootstrap-modalmanager.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/editinfo.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/holder.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/logout.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/bootstrap-dropdown.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I run it, I get this error:</p>
  
  <blockquote>
    <p>org.apache.jasper.JasperException: An exception occurred processing
    JSP page /editinfo.jsp at line 61</p>
  </blockquote>
  
  <p>Line 61 is:</p>
  
  <blockquote>
    <p>value="&lt;%=userInfo.getString("email")%>"</p>
  </blockquote>
  
  <p>I remove this line and it works perfectly fine (but I need this to get the value). When I keep line 61 and try to remove this:</p>
  
  <blockquote>
    <p>value="&lt;%=userInfo.getString("username")%>"</p>
  </blockquote>
  
  <p>which is at line 52 of my page, it still doesn't work.</p>
  
  <p>I also replace line 52 to line 61 and it works.</p>
  
  <p>I also get these errors:</p>
  
  <blockquote>
    <p>javax.servlet.ServletException: java.sql.SQLException: Column 'email' not found.
    java.sql.SQLException: Column 'email' not found.</p>
  </blockquote>
  
  <p>But I'm 100% sure that my database has an email column. Also, when I try this for the other columns of my database, it gives back the same error. It only works if it is "username" column. Please help me. How do I fix this?</p>