import java.io.*;import java.sql.*;import javax.servlet.*;import javax.servlet.http.*;public class ShowServlet extends HttpServlet{ @Override public void init(ServletConfig config)throws ServletException{ super.init(config); } @Override public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ ConnectDB cont=new ConnectDB(); ShowCheck showcheck=new ShowCheck(); String s=(String) request.getAttribute("gname"); String str="select * from infotable where username='"+s+"'"; cont.executeQuery(str); showcheck.setResultSet(cont.getResultSet()); try{ boolean s1=showcheck.getResultSet().next(); if(s1){response.sendRedirect("login.jsp");} }catch(SQLException e){System.out.print(e);} cont.close(); RequestDispatcher c_dispatcher=request.getRequestDispatcher("show.jsp"); c_dispatcher.forward(request, response); } @Override public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ doPost(request,response); }}出现以下错误:org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522) org.apache.jasper.servlet.JspServletWrapper.service(root cause java.lang.NullPointerException bean.ShowCheck.getString(ShowCheck.java:35) org.apache.jsp.show_jsp._jspService(show_jsp.java:74) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) org.apache.jasper.servlet.JspServlet.serviceJspFiletry{ while(rs.next()){ //35行 for(int i=0;i<5;i++){ buffer.append("<tr>"); buffer.append("<th>"+rs.getString(i)+"</th>"); buffer.append("</tr>"); } buffer.append("<th><Input type=checkbox name=ch value="); buffer.append(j); buffer.append(" </th>"); j=j+1; } }catch(SQLException e1){System.out.print(e1);}