web.xml不是需要部署么?
我还有其它的jsp文件,怎么写进web.xml中?什么格式?或者上面的web.xml文件不需要修改?

解决方案 »

  1.   

    你的问题跟web.xml无关,查错吧
      

  2.   

             
    有一段这样的代码:
      <%
                    String user=request.getParameter("Name");
                    String code=request.getParameter("Password");
                    String purview="", str="";
                    Connection conn;
                    Statement st;
                    ResultSet rs;
                    try{
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                        conn=DriverManager.getConnection("jdbc:odbc:DatebaseDesign","sa","sa");
                        st=conn.createStatement();
                        str="select * from Users where Names=\'"+user+"\' and Passwords=\'"+code+"\'";
                        rs=st.executeQuery(str);
                        if(rs.next()){
                            purview=rs.getString("Purview");
                            System.out.println(purview);
                            conn.close();
                            if(purview.equals("admin     ")){
                                response.sendRedirect("admin.jsp");
                                return;
                            }else{
                                response.sendRedirect("user.jsp");
                                return;
                            }
                        }else{
                            response.sendRedirect("error.html");
                            return;
                        }
                        
                    }catch(SQLException s){
                         s.printStackTrace();
                        //System.out.println(str);
                        out.print("<center><h3><操作失败,发生了错误!></h3></center>");
                    }catch(ClassNotFoundException c){
                     c.printStackTrace();
                        //System.out.println("驱动程序出问题了");
                        out.print("<center><h3><<操作失败,发生了错误!>></h3></center>");
                    }
                %>我用netbeans时没有问题。把NB里抽文件放到TOMCAT里时就出问题了。