public test() throws IOException,SQLException
to
public void test() throws IOException,SQLException
HttpServletResponse res;
to
HttpServletResponse res=null;ok now

解决方案 »

  1.   

    res没有实例化,还有没有找到HttpServletResponse 的类路径。
      

  2.   

    HttpServletResponse res 没有实力化
      

  3.   

    再问一个问题拉,这个test()方法,怎么在jsp里面调用啊?
      

  4.   

    You should send RESPONSE as a parameter to test, then you should create an instance of You class and invoke test(response).
      

  5.   

    昏头!!在BEAN中实现response.sendRedirect(),那么,我请问:"各位,如果在男人的肚子里实现生小孩?"
      

  6.   

    在bean中不能用response,不过你可以在servlet中使用。因为response是jsp的内建对象。
      

  7.   

    package examsys;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class yyq
    {
      public yyq(){}
      public test(HttpServletResponse res) throws IOException,SQLException
      {  
        res.sendRedirect("http://www.163.com");
      }
    }
    jsp中
    <%
     yyq y = new yyq();
     y.test(response);
    %>